-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
fix: only drain workers on graceful shutdown. #1405
base: main
Are you sure you want to change the base?
Conversation
func drainWorkers() { | ||
watcher.DrainWatcher() | ||
// DrainWorkers finishes all worker scripts before a graceful shutdown | ||
func DrainWorkers() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to make this function exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative would be to pass the 'soft shutdown' as a shutdown option if you prefer that.
frankenphp.Shutdown(frankenphp.WithSoftShutdown())
or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum not really, we'll also need a new symbol :D
Maybe could we make this function experimental at least?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm i guess you're right that would just be even more complicated 😅 . I'll mark the endpoint as 'experimental'
Should fix #1296
This PR changes the graceful shutdown to just drain all running worker scripts. It's faster and easier to just let the OS clean up all the remaining memory.