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.
Bug
pm2 reload a bonly reloadsa.bis silently dropped — no warning, and the process keeps running old code. We hit this in production (6.x):pm2 reload api workerafter a deploy leftworkeron the previous build. Code path is unchanged onmasteranddevelopment.Cause
stopandrestartare declared variadic inlib/binaries/CLI.js, butreloadis not:So commander parses only the first name and discards the rest. Consistent with that,
test/e2e/cli/multiparam.shexercises multi-namerestart/stop/deletebut has noreloadcase.Fix
Make
reloadvariadic and iterate with the sameforEachLimitpatternrestartuses (reload's internal lock makes sequential iteration the right shape). PR incoming, including a multi-name reload case in the multiparam e2e.