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

Allow setting graceful termination timeout for each task #522

Closed
F21 opened this issue Dec 1, 2015 · 5 comments
Closed

Allow setting graceful termination timeout for each task #522

F21 opened this issue Dec 1, 2015 · 5 comments

Comments

@F21
Copy link

F21 commented Dec 1, 2015

It would be nice if we could set a custom timeout for terminating tasks.

For example, I might have a task (running in docker) that provides an api for other services and takes a while to clean up on termination. I would like to be able to do the following:

  1. On termination, it is deregistered from consul so that no more new requests flow to it.
  2. It continues working to complete current requests and sends a response.
  3. If it does not terminate in the duration of the timeout set for graceful termination, nomad kills it forcefully (to prevent tasks from hanging around for ever).
  4. If it does terminate gracefully, all is well.
@dadgar
Copy link
Contributor

dadgar commented Dec 1, 2015

Yeah that is a possibility. Nomad already does this. It first does a SIGTERM and then a SIGKILL but the period is not user specifiable currently. Do you need it to be configurable or you just want the soft kill then hard kill behavior?

@F21
Copy link
Author

F21 commented Dec 1, 2015

I would love to be able to configure the timeout, because some tasks might take a bit longer to clean up (hence a longer timeout).

@cbednarski
Copy link
Contributor

This is a duplicate of #17

@dadgar
Copy link
Contributor

dadgar commented Jan 4, 2016

Fixed by #624

@dadgar dadgar closed this as completed Jan 4, 2016
copyconstruct added a commit to copyconstruct/nomad that referenced this issue Jul 1, 2017
Thee docs suggest that when the `kill_timeout` is specified, a task is sent a SIGINT. However, I'm seeing my task get a SIGTERM.

This comment by @dadgar also suggests that it's a SIGTERM that gets sent to a task. hashicorp#522
copyconstruct added a commit to copyconstruct/nomad that referenced this issue Jul 1, 2017
The docs suggest that when the `kill_timeout` is specified, a task is sent a SIGINT. However, I'm seeing my task get a SIGTERM.

This comment by @dadgar also suggests that it's a SIGTERM that gets sent to a task. hashicorp#522
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants