-
Notifications
You must be signed in to change notification settings - Fork 954
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
monitor children and re-fork when they exit #615
base: master
Are you sure you want to change the base?
Conversation
From experience trying to do this, I can say there are a bunch of edge cases this does not cover. Just use the DJ binary. |
what is the dj binary/does it cover the issue in #565 ? |
bin/delayed_job or script/delayed_job for older versions of rails Sent from my iPhone
|
but those don't support NUM_PROCESSES for running multiple workers on a single dyno correct? |
You are correct The problem is that while your code will possibly work for your use case, it will not work in general. If we included this in the release, we would receive a bunch of issue reports of this not working in all situations. In order to be included in the main release, the code needs to work for most cases, not just one. |
Got it - I understand it doesn't make sense to include if it causes problems. What are the problems/bugs? I'd like to fix them if possible. |
Lets clean this up and pull it in as a use at your own risk feature.
|
1. Maintain and log worker name and pid on fork 2. Detect and log which worker died. 3. Move the fork_delayed definition out into the namespace 4. Remove do from while loop 5. Trap TERM and stop creating new workers
Sounds good. I've made all the changes except "Cleanup forked workers on exit" - I'm not sure how best to do that. |
+! here for a solution to this for heroku. I tried a workaround using a shell script, but for some reason logging gets lost. Here's my shell script (joshco_jobs)
My procfile entry
|
00c7e65
to
27ce6b0
Compare
This PR can be closed in favor of #1138 |
Adding to wkonkel's pull request #565 - adding code to monitor children and re-fork them when they exit.