-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add reload_worker_directory to pumactl #478
Conversation
Be aware that you may need to configure some other things too:
|
Workers should reload directory automatically, it make no sense to add a extra command to reload the path. I think this behavior should be chain-linked to phased-restart. |
People who care about phased-restart should have at least tested if their app is booting before sending it to production. |
@seuros 3 quick points come to me:
I hope that helps you understand this pull request's motivation. Anyway, I'm open to suggestions about how to solve the problem in #468 and #469 . Thanks. |
Thank you. |
@seuros It's ok. Let's solve things. Maybe we can provide Maybe a block passed on configuration that gets run at some specific point after restart? Not sure about the whole restart process and where to put that control point. And then what kind of notifications could be sent. Should we wait for it to end? Should it be async and then be polled? Any ideas? |
Sorry, i have difficulties explaining myself. It should restart and only show a error message if it fail : Failure scenario :
Success scenario :
|
@seuros I'm sorry too then. I misunderstood your comments. Sorry. Your two scenarios sound perfect to me. It would be great to get that from puma. The main problem is how we get to that, because puma itself doesn't know how to tell that a worker is not only booted, but healthy enough to be considered stable code for future workers to be spawned. If we were able to pass a block of application-specific code to puma, then it could run it to get the health level of each worker. This way decide if it is good enough to consider it stable code. If it's not good enough, then throw something like By getting the health level of a worker I mean nothing fancy. Just some plain vital signs gathered from within the beast itself. Although once you are there, any kind of test code can be run. Either way, it's app-specific code, it's up to you. What do you think? |
Check #483 |
Nice! We already have the callback! Then the only thing left to do is to put the health checking code in there, and then setup some way to tell puma if the new code is stable or not. Any way to do this? |
I'm wrong, this callback is not usefull since it will never be called if the application fail to boot. |
@evanphx Any help here ? |
@seuros I think you had at least some good point that put us closer to a nice solution. The current And the proposed We should find a way to tell puma that the code is good from inside our app. Maybe there is already a reference to the master process, or maybe we need to call the proposed @evanphx will know better, I'm ok? |
Don't worry about the hooks, this is something that should be built-in to puma. Probably the right way to handle it is, when doing a worker restart:
|
+1 for that |
What's the status of this? We are having issues with phased restarts and symlinked deploys also. |
Add reload_worker_directory to pumactl
This allows to renew the code directory for newly spawn workers from the master process, all from
pumactl
.Provides a harmless workaround to #469 and #468.
This way when I perform a deploy with a
phased-restart
(using symlink deployment), and only after I ensure this is a good release, then I dopumactl reload-worker-directory
. All workers automatically spawn by the master process will use the new code.I perform two checks to ensure this is a good release. First I poll
pumactl stats
until I see the number ofworkers
equal the number ofbooted_workers
. Then I make a call to some private\release
path to get the code git release it's running. Then I'm sure every worker is up and they are running the new code.My current restart output looks like this: