Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to stop all other process on one process completion #77

Closed
adrian-gierakowski opened this issue Jul 21, 2023 · 2 comments · Fixed by #78
Closed

add option to stop all other process on one process completion #77

adrian-gierakowski opened this issue Jul 21, 2023 · 2 comments · Fixed by #78

Comments

@adrian-gierakowski
Copy link
Contributor

adrian-gierakowski commented Jul 21, 2023

Feature Request

Similar to exit_on_failure but also exists if give process exits with 0 status

Use Case:

Running integration tests, where multiple supporting services (databases etc.) need to be started first, followed by the test executor process. Once test executor completes (regardless of exit code), all other processes should be shut down and PC should exit with the code returned by test executor.

Proposed Change:

add boolean flag: availability.exit_on_end
the reason why this is not just another option in availability.restart is that you might want to restart a process on failure up to certain amount of times, and only once retries are exhausted (or once process completes successfully) shut down all processes.

Who Benefits From The Change(s)?

Anyone which wishes to run one-shot a process which need other processes to run in the background while the main process is executing.

Alternative Approaches

One could execute process-compose process stop PROCESS_NAME for all supporting processes once the main process finished

@adrian-gierakowski
Copy link
Contributor Author

I think I might take a stab at it, since it seems like it should be relatively easy

adrian-gierakowski added a commit to rhinofi/process-compose that referenced this issue Jul 21, 2023
a bool flag, if set to true, shuts down all processes once
given process ends (regardless of exit code)

this can be used together with `availability.restart = on_failure` to
have the process restarted on failure and only exit PC on success

closes F1bonacc1#77
@adrian-gierakowski
Copy link
Contributor Author

#78

F1bonacc1 pushed a commit that referenced this issue Jul 21, 2023
* feat: availability.exit_on_end

a bool flag, if set to true, shuts down all processes once
given process ends (regardless of exit code)

this can be used together with `availability.restart = on_failure` to
have the process restarted on failure and only exit PC on success

closes #77

* docs: document availability.exit_on_end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant