New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing graceful shutdown #46
Comments
I did some more test and it seems like looping through all of the registered functions and calling For some reason Is there a reason why |
You can use gearman-packet library to implement a simple low-level client to test whether "the gearmand stops passing the results on after unregistering the work". Note that on protocol level graceful shutdown should be implemented by avoiding sending Also you can review the code/detailed logs to see if Note that we do need to support one-shot workers, that is graceful shutdown after receiving the first job. See @amv comment on #19 Upd; Ahaha I didn't see that it's you. |
As for
|
I did a quick test by modifying the
To a different implementation:
From this test I would guess that it is the |
Can you test with "our" abraxas-based Javascript server? |
Both |
I am trying to implement a graceful shutdown for my workers, meaning that when I receive a signal (or otherwise decide so), all of my workers should continue doing their job, but no new jobs should be accepted.
My current implementation is to call
client.forgetAllWorkers()
when receiving the signal, and then waiting for all of the jobs to do their thing before exiting. I only callclient.disconnect()
some seconds after the last job has finished executing (and should have delivered it's payload).Unfortunately at least with the C version of the gearmand server, the results of these jobs that finish after the
client.forgetAllWorkers()
never reach the clients who have submitted the jobs.So either the gearmand stops passing the results on after unregistering the work, or abraxas fails to deliver the results after
client.forgetAllWorkers()
has been called.In the former case I would need a way to tell abraxas to stop grabbing any future jobs even though the functions are still registered.. And in the latter case I would love to have a fix for this on abraxas side..
Would anyone happen to come up with a simple way to test which of these theories (or some alternate one) is the case?
The text was updated successfully, but these errors were encountered: