'pm2 stop' doesn't kill the process
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
Software Components: PM2 version: 4.4.1 , Windows 2016 server, Node.js version : 12.13.1
PM2 stop <app_name> , doesn't stop the process. It shows the status as "errored".
When I check the process in Windows Task Manager, I see the application process running even after Pm2 stop <process_name>.
Also, tried with increasing the Kill Timeout as well as with forceful (-f) option , but no luck.
Below is the log message even if there is no traffic -
2020-09-21T23:47:29: PM2 log: pid=9916 msg=failed to kill - retrying in 100ms
2020-09-21T23:47:29: PM2 log: pid=9916 msg=failed to kill - retrying in 100ms
2020-09-21T23:47:29: PM2 log: pid=9916 msg=failed to kill - retrying in 100ms
2020-09-21T23:47:29: PM2 log: Process with pid 9916 could not be killed
2020-09-21T23:47:29: PM2 error: app=testMS id=1 pid=9916 could not be stopped
As a workaround, I'm doing with "pm2 delete all" ; and then "pm2 restart all"
But, I have some requirement where I need to stop with - "pm2 stop <process_name>" only
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 reproducing the Windows Server 2016 failure with the pm2 stop <process_name> command and inspect the logged failed to kill and could not be stopped messages. Trace the stop command's Windows process-termination path, then verify that the target process exits and PM2 reports it as stopped rather than errored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100