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

Forcefully terminate all processes with a configured shutdown timeout #240

Closed
wants to merge 3 commits into from

Conversation

anrddh
Copy link
Contributor

@anrddh anrddh commented Aug 30, 2024

Fixes #214

I'm not entirely convinced this change is race free, but it should be. I would appreciate if someone double checked my handling of the p.waitDone channel.

I assume that a modification to the docs is in order. I can take a look at that once this change is otherwise accepted.

anrddh added 3 commits August 26, 2024 23:10
This sets the stage for a new, more generic BuildCommandContext.
We start all procs as CommandContexts instead of Commands, with a
WithCancel context attached. A context cancellation handler which tries
to stop the application gracefully, waits the specified amount of time,
and subsequently SIGKILLs if the process hasn't stopped already is
attached to the CommandContext.

The CommandContext type internally has some synchronization to try to
minimize the chances of races between the context cancellation handler,
and normal termination of applications.
@anrddh anrddh force-pushed the forced-termination branch from 5ab22e0 to 7abd809 Compare August 30, 2024 03:55
Copy link

@F1bonacc1
Copy link
Owner

Resolved as part of 891f742

@F1bonacc1 F1bonacc1 closed this Sep 22, 2024
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.

Force terminate apps if shutdown.timeout_seconds is defined, without requiring shutdown.command to be defined
2 participants