You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] A lifecycle command script keeps running after Ctrl+C stops the APM command #3675
area/cliCLI command surface, flags, help text (cross-cutting).pillar/foundationsPillar: reliability, platforms, CI, code healthtype/bugSomething does not work as documented.
Lifecycle command scripts run in their own process group. When the user presses Ctrl+C while a script runs (for example the new pre-compile event), APM prints "Aborted!", exits 1 and releases its lifecycle lock, but the script process is not stopped. It keeps running and can write files after APM has exited. The docs say the script runs while the command holds APM's lifecycle lock.
To reproduce
In apm.yml add a pre-compile command script: echo started > started.txt; sleep 8; echo late > .apm/instructions/late.instructions.md.
apm lifecycle trust, then apm compile.
Press Ctrl+C once started.txt exists, wait 10 seconds.
Expected behavior
Interrupting APM stops the running lifecycle script before APM exits, and the script log records the interruption.
Actual behavior
APM exits; about 4 seconds later the orphaned script writes .apm/instructions/late.instructions.md.
Found by the 0.36.0 pre-release lifecycle sweep, round 2 (#3649). The executor behavior predates 0.36 (pre/post-install scripts on v0.35.1); 0.36 adds the pre-compile event that reaches it.
area/cliCLI command surface, flags, help text (cross-cutting).pillar/foundationsPillar: reliability, platforms, CI, code healthtype/bugSomething does not work as documented.
Activity