Fast command line app in rust/tokio to run commands in parallel. Similar interface to GNU parallel or xargs plus useful features. Listed in Awesome Rust utilities.
MIT License
146
stars
7
forks
source link
Alternative error behaviours to `--exit-on-error` #22
Running multiple processes from a single docker instance, e.g. a webserver + background task processor.
I used to do this using GNU parallel, but for various reasons it's caused me problems, and I wanted a simple binary parallel runner instead, so rust-parallel sounded like a good fit.
--exit-on-error currently doesn't meet this usecase: given each process is infinite, unless a termination is sent to the other processes, the docker container will not exit on error, this usecase requires the container to exit if any process dies. (a container exits when it's entrypoint command finishes)
In my scenario ideally rust-parallel could:
If any process errors, instantly send SIGTERM+SIGHUP to all running processes, allowing the processes the ability to "cleanly" exit.
After a period of time, e.g. 15 seconds, remaining processes that have not exited after the soft kill, are sent SIGKILL to forcefully end the processes.
That's the ideal scenario, the exact cli params that offer that generically I don't claim to be 100% sure of!
As mentioned in #21:
Current usecase:
--exit-on-error
currently doesn't meet this usecase: given each process is infinite, unless a termination is sent to the other processes, the docker container will not exit on error, this usecase requires the container to exit if any process dies. (a container exits when it's entrypoint command finishes)In my scenario ideally rust-parallel could:
SIGTERM+SIGHUP
to all running processes, allowing the processes the ability to "cleanly" exit.SIGKILL
to forcefully end the processes.That's the ideal scenario, the exact cli params that offer that generically I don't claim to be 100% sure of!