Improve-worker (#7367)

* ♻️ refactor(worker): remove goto

* ♻️ refactor(worker): let manager loop exit by itself

* ♻️ refactor(worker): fix race condition when closing worker

CloseSend is not safe to call when another
goroutine concurrently calls Send. streamCancel
already handles proper stream closure. Also,
streamExit signal should be called AFTER
sending shutdownMsg

Now the worker has no race condition if stopped
during any moment (hopefully, tested with -race
flag)

* 🐛 fix(task_logger): deadlock in log closure

* 🐛 fix(balance): fix balance task

Removes the outdated "UnloadVolume" step as it is handled by "DeleteVolume".

#7346
This commit is contained in:
Mariano Ntrougkas
2025-10-24 03:09:46 +03:00
committed by GitHub
parent 557aa4ec09
commit f06ddd05cc
4 changed files with 12 additions and 36 deletions

View File

@@ -232,6 +232,7 @@ func (l *FileTaskLogger) LogWithFields(level string, message string, fields map[
// Close closes the logger and finalizes metadata
func (l *FileTaskLogger) Close() error {
l.Info("Task logger closed for %s", l.taskID)
l.mutex.Lock()
defer l.mutex.Unlock()
@@ -260,7 +261,6 @@ func (l *FileTaskLogger) Close() error {
}
l.closed = true
l.Info("Task logger closed for %s", l.taskID)
return nil
}