|
|
|
|
|
by pier25
611 days ago
|
|
> the Node way of doing things seems to be "just let the process crash and restart it" Honestly I've never heard of anyone advocating for this. PM2 is only necessary if you're running Node in like a VPS where you're in charge of managing the process. In managed solutions like Fly, Google Cloud Run, etc you never really have to care about this. VMs are restarted automatically and it's trivial to have HA with multiple VMs running in parallel. |
|
I've seen numerous engineers advocate for letting the app crash (or at least gracefully shutting it down), capturing the error, and restarting. Errors crash the Node process by design after all. Perhaps it's not as prevalent as it used to be, but it was certainly considered acceptable and even desirable for a time to let the app crash and restart it with pm2, forever, etc. since an error could leave the app in an unknown state.
citizen has a config option for keeping the app running or exiting the process in the event of an error, so it's up to the dev.