[Feature Request] Application health-check (reboot on failure)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
What's going wrong?
pm2 is monitoring Node.js processes and restarts them automatically. This works fine but if processes are blocking, e.g. due to a deadlock or other runtime issues, the Node.js process is kept in its blocked state forever. On the OS level it is possible to use a hardware watchdog and for instance a systemd service to verify all processes are responsive. I would like to have such a feature in pm2 to send periodically events from JavaScript or native code to reset a watchdog timer in pm2. If the Node.js process is no longer sending events it shall be restarted.
We are using pm2 on IoT devices and a 100% uptime is crucial. At the moment only crashes are covered but not all other situations.
The watch feature could be a way to implement this feature using a second Node.js app which monitors the first one.
This is not a bug report, this is a feature request.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing PM2’s existing watch feature and how it monitors and restarts Node.js processes. Clarify the heartbeat or watchdog event contract, timeout behavior, and restart conditions; done should include a responsive-process case and a blocked-process case that reliably triggers recovery.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- devops, observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100