-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
OnApplicationShutdown hook #312
Comments
Thank you for your issue. Nice digging!
I do not think this would solve the problem in a clean way. My strategy will be once How urgent is this issue for you - since I can't control when my PR gets merged. Otherwise I could make it workaround-able for the time being. |
Thank you for your quick response. |
@BrunnerLivio, I opened pull with the fix for this issue. Could you make a review? |
Resolved in 7.0.0 🎉 |
I'm submitting a...
Current behavior
I have an app with the Terminus module and the app also have the shutdown hooks enabled.
When I try to stop the app with a SIGTERM, the underlying http server is closed before the shutdown hooks are executed. It also trigger two times the shutdown hooks.
Expected behavior
The http server should stay until all shutdown hooks are resolved and the onApplicationShutdown hook should be call only one time.
Minimal reproduction of the problem with instructions
Clone this repo
Compile the app with
npm run build
then start it.Curl the local server with
curl --location --request GET "localhost:3000/"
and stop the process with a SIGTERM while request is being processed.What is the motivation / use case for changing the behavior?
The server should be able to process already accepted requests before shutting down.
Environment
Possible solution :
The problem seems to come from there with this not allowing the configuration of the beforeShutdown hook on godaddy/terminus. Allowing user to configure the beforeShutdown hook here or setting a promise based timeout should fix the http server problem.
The text was updated successfully, but these errors were encountered: