Comments (5)
https://jrfom.com/posts/2023/12/15/node-process-management/
from fastify.
My advice is use proper tools to do so, for example SystemD
, Container
.
And you should never recover the unhandledRejection
inside node.js
.
from fastify.
Thanks for the suggestion!
Yeah, I have an idea that it's more related to Node.js exception handling. It seems like the issue could be resolved if I handle exceptions on every promise individually. However, I'm curious if there's a way to handle them more gracefully on a process or global level.
from fastify.
You can listen to the event and gracefully shutdown your application.
process.on('unhandledRejection', (reason, promise) => {
// logging or something else...
});
process.on('uncaughtException', (err, origin) => {
// logging or something else...
});
Remember DO NOT restart your application after you face those error, you may face unexpected condition.
from fastify.
close-with-grace is pretty handy for this.
Closing as this is not Fastify related.
from fastify.
Related Issues (20)
- Route schema might be undefined HOT 4
- Wrong DecorationMethod type
- Should "disableRequestLogging" suppress aborted requests? HOT 2
- `addContentTypeParser` doesn't work well after `await register` HOT 5
- Upload file always raises error FST_ERR_CTP_INVALID_CONTENT_LENGTH HOT 2
- Using fastify with Phusion Passenger fails with EADDRINUSE HOT 1
- `disableRequestLogging` should disable logs in default error handler HOT 6
- incorrect plugin identified for timeout HOT 1
- Backport webdav methods from next to current branch HOT 7
- OPTIONS HTTP method body processing HOT 3
- Dependency update for v5 HOT 1
- Merge main into next HOT 4
- Scoped FastifyRequest Customization via Generic Parameter in FastifyInstance HOT 1
- Flaky test on N|Solid 20 MacOS HOT 2
- Implement simple B-Tree for faster string comparisons HOT 9
- Throwing error in setErrorHandler after a JSON parse SyntaxError causes app to crash
- Where is the documentation for <Reply>.sendFile? HOT 2
- Switch to ajv/2020 for fastify 5 HOT 7
- Fastify v5 coordination HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastify.