-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Gracefully shutdown #260
Comments
I’m really -1 to have them as default features. They seems very good ideas on the application side, but they cause loads of interactions with other modules, as process is a global. IMHO it’s perfect content for a plugin. |
Do you mean a plugin should emit the |
You just need to add the logic to gracefully shutdown in the plugin, and call |
Add label "Plugin suggestion" ? :D |
I think this should be done by the developer. How much do you need to plug in for this? What kind of usage do you think |
Hi, could you check it out https://github.com/hemerajs/fastify-graceful-shutdown |
You really don't want to listen to
And having to make very clear to users that you have registered for those events. Once something is registered on those events Node does not perform its normal shutdown procedure. |
What is the alternative to gracefully shutdown the application? You have to listen on events outside of your environment e.g in container environment or through a simple ctrl+c. |
I agree with you it can complicate things but at first, this functionality is provided as a plugin and if you know that you have one interface to release your resources, it's legitimate. |
Pino is always a part of a bigger application that's why you have to care about your environment. Fastify is the head of your application and if you want to release something use |
IMHO listening to those events in a library is always going to cause problems, as it is assuming that a framework is going to “control” the process. There are a lot of scenarios where that causes very hard to debug scenarios. IMHO it is not a functionality I’m ok to maintain, however if you want to release it as a plugin, it should contain a big warning that it should not be registered twice, or the process might be left in an hard to debug state. I’ll do a quick review of the code, and maybe suggest a few counterbalances to the most common problems. |
I just don't see the point. All of this is stuff I would put in a |
@jsumners I'm on your side but this plugin should just support it and centralize the functionality. If you create a plugin which has to clean up resources you can register it with The main difference is that we are talking about a plugin system not applications. In this case fastify should provide the interface (e.g by plugin) |
I don't see this discussing going anywhere. The functionality is already done inside a plugin and we can close this. |
The server should shutdown gracefully that implicit
The text was updated successfully, but these errors were encountered: