Manager: when worker goes to sleep, log in task log which worker
When a worker's tasks get requeued because it goes to sleep, the task log will now mention the worker identification (name + UUID). This aids in figuring out what happened to tasks.
This commit is contained in:
parent
3f3f5d782f
commit
b26374d480
@ -253,7 +253,7 @@ func (f *Flamenco) WorkerStateChanged(e echo.Context) error {
|
||||
// Re-queue all tasks (should be only one) this worker is now working on.
|
||||
if prevStatus == api.WorkerStatusAwake && w.Status != api.WorkerStatusAwake {
|
||||
err := f.stateMachine.RequeueActiveTasksOfWorker(bgCtx, w,
|
||||
fmt.Sprintf("worker changed status to '%s'", w.Status))
|
||||
fmt.Sprintf("worker %s changed status to '%s'", w.Identifier(), w.Status))
|
||||
if err != nil {
|
||||
logger.Warn().Err(err).Msg("error re-queueing worker tasks after it changed to non-awake status")
|
||||
}
|
||||
|
@ -349,7 +349,8 @@ func TestWorkerStateChanged(t *testing.T) {
|
||||
savedWorker.Status = api.WorkerStatusAsleep
|
||||
mf.persistence.EXPECT().SaveWorkerStatus(gomock.Any(), &savedWorker).Return(nil)
|
||||
mf.persistence.EXPECT().WorkerSeen(gomock.Any(), &worker)
|
||||
mf.stateMachine.EXPECT().RequeueActiveTasksOfWorker(gomock.Any(), &worker, "worker changed status to 'asleep'")
|
||||
mf.stateMachine.EXPECT().RequeueActiveTasksOfWorker(gomock.Any(), &worker,
|
||||
"worker дрон (e7632d62-c3b8-4af0-9e78-01752928952c) changed status to 'asleep'")
|
||||
|
||||
// Perform the request
|
||||
echo := mf.prepareMockedJSONRequest(api.WorkerStateChanged{
|
||||
|
Loading…
x
Reference in New Issue
Block a user