shenwei356 / rush

A cross-platform command-line tool for executing jobs in parallel
https://github.com/shenwei356/rush
MIT License
846 stars 63 forks source link

Ctrl+C improvements, fixes #17 #18

Closed bburgin closed 5 years ago

bburgin commented 5 years ago

Fixes #17

  1. Added graceful Ctrl+C logic, for these user operations: a. The user presses Ctrl+C during a rush run, or b. The user has specified -e and a child process returns an error
  2. rush now follows this fallback sequence for Ctrl+C: a. Sends Ctrl+C to child processes b. Waits for child processes to disappear or cleanup time to elapse c. If processes still exist, sends Ctrl+Break to child processes d. Again, waits for processes to disappear or cleanup time to elapse e. If processes still exist, finally kills child processes
  3. I removed the --kill-on-ctrl-c arg and added --no-stop-exes, --no-kill-exes, and --cleanup-time args a. There is no need for the --kill-on-ctrl-c arg now. I have removed it in lieu of the more flexible --no-kill-exes arg. b. The user needs to use the new --no-kill-exes arg and can rely on its default value of empty list to get the old default behavior of --kill-on-ctrl-c arg=true c. For the old --kill-on-ctrl-c=false behavior, the user needs to specify --no-kill-exes all
shenwei356 commented 5 years ago

Thank you so much!