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

perform graceful termination of process compose #5

Merged
merged 1 commit into from
Jun 25, 2022

Conversation

F1bonacc1
Copy link
Owner

No description provided.

@F1bonacc1
Copy link
Owner Author

This should finalize the #3 issue

@F1bonacc1 F1bonacc1 merged commit 8c85b1b into main Jun 25, 2022
@F1bonacc1 F1bonacc1 deleted the feature/graceful-shutdown-on-process-compose-exit branch June 25, 2022 20:02
@F1bonacc1 F1bonacc1 restored the feature/graceful-shutdown-on-process-compose-exit branch June 25, 2022 20:04
@F1bonacc1 F1bonacc1 deleted the feature/graceful-shutdown-on-process-compose-exit branch June 25, 2022 23:31
func (p *Process) shutDown() error {
if !p.isState(ProcessStateRunning) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is messing my use-case up.
With the pg_ctl start example, the process goes to completed state, since it exits with 0 status code.
In this case the shutdown command not run.
For the sake of simplicity, I think we can ask users to provide an idempotently runnable / non-failing command like:

pg_ctl stop || true

and run it regardless of process state.

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 this pull request may close these issues.

2 participants