concurrently icon indicating copy to clipboard operation
concurrently copied to clipboard

`killOthers` won't fully terminate others if also `restartTries >= 1`

Open sod opened this issue 6 months ago • 2 comments

If you use concurrently like:

node_modules/.bin/concurrently 'node foo.js 0' 'node foo.js 1' --kill-others --restart-tries 2
// foo.js - test script, `node foo.js 0` dies after 100ms, `node foo.js 1` stays alive
const id = process.argv[2];
console.log(`Hello world from id ${id}`);
if (id === '0') { setTimeout(() => { process.exit(1) }, 100) /* kill id 0 */ }
else { setTimeout(() => {}, 99999999) /* keep id 1 alive */ }

What happens:

It restarts process 0 twice, then runs the kill-others command. But the kill other is catched by another retry.

CleanShot 2024-08-05 at 14 20 10@2x

What I expected

if restart-tries has been exhausted, then kill-others should tear down the rest for good.

sod avatar Aug 05 '24 12:08 sod