How is single-worker recycling supposed to work after max_tasks_per_child is reached? #608
Unanswered
aysanorhun
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to understand the intended worker recycle/restart model. From reading the worker, receiver, and process manager code, this is how it looks to me:
max_tasks_per_childis reached, the worker stops prefetching, waits for running tasks to finish, and goes through shutdown, but the process itself does not exitWhat I want to clarify is how restarting a single worker is supposed to work. As far as I can tell:
SIGINT/SIGTERMare shutdown signals, not restart signalsSIGHUPreloads all workersReloadOneActionrestarts one worker, but I do not see a supported way to trigger that for a specific worker from within worker codeRight now, the only way I was able to make a specific worker get recycled was to add
os._exit(1)in the worker shutdown path so the process exits and the manager respawns it. So my questions are:max_tasks_per_childis reached, is the intended behavior that the worker only goes through shutdown, or that the worker process exits and the parent respawns it?os._exit(1)?My use case is that I do not want to restart all workers. I want to recycle a specific worker once
max_tasks_per_childis reached.Beta Was this translation helpful? Give feedback.
All reactions