Skip to content

Alternative error behaviours to --exit-on-error #22

@zakstucke

Description

@zakstucke

As mentioned in #21:

Current usecase:

  • 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions