Unitech / Unitech/pm2

pm2 stop only seems to kill 2 processes at a time?

Open
#5,500 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

Using the latest pm2 on ubuntu 20.04.

I have a config.js file that starts 50 copies of my program. Starting it works fine, all start immediately.

However when using "pm2 stop my_config.js" I notice it takes a long time, because my program catches the signal and does some cleanup work before exiting, and pm2 only seems to be sending signals to groups of 2 out of my 50 processes at a time?

I see it stop 2 processes... then 2 more... etc. It takes a long time for all 50 to get stopped because it doesn't appear to send signals simultaneously to all 50 processes. Can I configure it somehow to kill all 50 at once?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the PM2 stop command entry point and trace how it signals processes in a configured group. Reproduce the behavior with config.js starting 50 copies and cleanup handlers that delay exit. Done means the stop behavior or its configuration is documented and verified against all 50 processes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, ubuntu
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.