pm2 reload app1 app2 silently ignores every name after the first
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
Bug
pm2 reload a b only reloads a. b is silently dropped — no warning, and the process keeps running old code. We hit this in production (6.x): pm2 reload api worker after a deploy left worker on the previous build. Code path is unchanged on master and development.
Cause
stop and restart are declared variadic in lib/binaries/CLI.js, but reload is not:
commander.command('stop <id|name|namespace|all|json|stdin...>') // variadic
commander.command('restart <id|name|namespace|all|json|stdin...>') // variadic
commander.command('reload <id|name|namespace|all>') // NOT variadic — extra names dropped by commander
So commander parses only the first name and discards the rest. Consistent with that, test/e2e/cli/multiparam.sh exercises multi-name restart/stop/delete but has no reload case.
Fix
Make reload variadic and iterate with the same forEachLimit pattern restart uses (reload's internal lock makes sequential iteration the right shape). PR incoming, including a multi-name reload case in the multiparam e2e.
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 in lib/binaries/CLI.js, comparing the reload command with the variadic stop and restart declarations and their forEachLimit handling. Run test/e2e/cli/multiparam.sh, then add the multi-name reload case described in the issue and confirm that every supplied name is reloaded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100