Guard a GPU-less node's problems, and bound thread ids
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a56ad8e4c4
commit
f9493aadb9
6 files changed
+64
-1
No files matched your search
@@ -316,3 +316,12 @@ func TestAnotherTenantOnACardIsJudgedEveryHeartbeat(t *testing.T) {
|
||||
t.Errorf("a heartbeat with no foreign reading cleared the card: %q", n.GPUs[0].Health.Problems)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAProblemOnANodeWithoutGPUsDoesNotPanic(t *testing.T) {
|
||||
s := newTestService()
|
||||
nodeWith(s, inventory.Node{ID: "cpu1", State: inventory.Ready})
|
||||
s.applyHeartbeat("cpu1", &llmgwv1.Heartbeat{NodeId: "cpu1", NewProblems: []string{"disk read errors"}})
|
||||
if _, ok := s.inv.Get("cpu1"); !ok {
|
||||
t.Fatal("the node is gone")
|
||||
}
|
||||
}
|
||||
@@ -454,7 +454,7 @@ func (s *Service) applyHeartbeat(nodeID string, hb *llmgwv1.Heartbeat) {
|
||||
n.GPUs[i].Health.Problems = ps
|
||||
}
|
||||
}
|
||||
if len(problems) > 0 {
|
||||
if len(problems) > 0 && len(n.GPUs) > 0 {
|
||||
// Problems are reported per node, not per GPU, so attach them to the
|
||||
// node's first GPU rather than guessing which one is affected. Any
|
||||
// problem is enough to keep that GPU out of placement, which is the
|
||||
|
||||
Reference in new issue
Block a user