#6132·pm2

pm2 reload app1 app2 silently ignores every name after the first

Author: MuhammadFarhantahirCreated Jul 18, 2026Updated Jul 18, 2026

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:

javascript
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.