pm2 stop causes watching to stop working
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?
after pm2 stop and pm2 start command, the watching feature not working at all even pm2 list showing it is enabled.
The only similar issue is found in https://github.com/Unitech/pm2/issues/4434 but no one answering and the bot just closed it.
How could we reproduce this issue?
Reproduction Step:
- Start the app with
pm2 start ecosystem.js
- ecosystem.js file has
watch: trueenabled pm2 listalso showing watching enabled- It works like charm until
pm2 stopcommand is used. - after using
pm2 stopandpm2 startthe process id, it does not works as expected andpm2 liststill showing watching enabled.
Expected Behavior
pm2 stop and pm2 start the process, user save anything in any watching directory will trigger file change and restart the process.
Supporting information
$ pm2 report
--- Daemon -----------------------------------------------
pm2d version : 5.2.2
node version : 16.16.0
--- CLI ----------------------------------------------------
local pm2 : 5.2.2
node version : 16.16.0
--- System info --------------------------------------------
arch : x64
platform : darwin
type : Darwin
The only workaround to restart and remain watching are:
pm2 restartinstead ofpm2 stopandpm2 start- or
pm2 deletethe process andpm2 startagain - or
pm2 killandpm2 startagain
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
No source file or test is named. Start by reproducing the issue with ecosystem.js using pm2 start, pm2 stop, and pm2 start, then inspect the watch state and process lifecycle around those commands. Done means watching remains functional after stop and start, with a regression test covering the sequence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100