Skip to content

Commit ad7fdf5

Browse files
Copilotknopers8
andcommitted
Fix race condition: Change error to debug for BASIC_TASK_TERMINATED with no parent role
Co-authored-by: knopers8 <14327588+knopers8@users.noreply.github.com>
1 parent 658b099 commit ad7fdf5

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

core/environment/manager.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,10 +1070,13 @@ func (envs *Manager) handleDeviceEvent(evt event.DeviceEvent) {
10701070
}
10711071
}
10721072
} else {
1073+
// Task has no parent role - this can happen during environment teardown
1074+
// when tasks are released before termination events are processed
10731075
log.WithPrefix("scheduler").
10741076
WithField("partition", envId.String()).
1077+
WithField("taskId", taskId.Value).
10751078
WithField(infologger.Level, infologger.IL_Devel).
1076-
Error("DeviceEvent BASIC_TASK_TERMINATED received for task with no parent role")
1079+
Debug("DeviceEvent BASIC_TASK_TERMINATED received for task with no parent role, likely due to environment teardown")
10771080
}
10781081
} else {
10791082
log.WithPrefix("scheduler").

core/environment/runcounter.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9
1+
18

0 commit comments

Comments
 (0)