-
Notifications
You must be signed in to change notification settings - Fork 2k
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
client: enforce max_kill_timeout client configuration #13626
Conversation
This PR fixes a bug where client configuration max_kill_timeout was not being enforced. The feature was introduced in 9f44780 but seems to have been removed during the major drivers refactoring. We can make sure the value is enforced by pluming it through the DriverHandler, which now uses the lesser of the task.killTimeout or client.maxKillTimeout. Also updates Event.SetKillTimeout to require both the task.killTimeout and client.maxKillTimeout so that we don't make the mistake of using the wrong value - as it was being given only the task.killTimeout before.
8042054
to
dbcccc7
Compare
Spot checking nomad.hcl client {
max_kill_timeout = "5s"
} rexec.hcl job "rexec" {
datacenters = ["dc1"]
group "rexec" {
task "rexec" {
driver = "raw_exec"
kill_timeout = "1m"
config {
command = "/bin/bash"
args = ["local/script.sh"]
}
template {
data = <<EOF
trap 'echo "Received SIGINT"' INT
while true
do
echo 'Running'
sleep 1
done
EOF
destination = "local/script.sh"
}
}
}
} start nomad with config
run job
stop alloc
Task is correctly force-killed after
Making sure we respect the task setting if it is less than
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be worth adding an upgrade notice. Even though this is how it was always supposed to work, this fix will impact any task with kill_timeout > 30s
if the client config is not set.
Just notice that it doesn't have the |
Added I'll add the upgrade note in a follow up PR ... don't wanna miss this chance for a perfect score on CI |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR fixes a bug where client configuration
max_kill_timeout
wasnot being enforced. The feature was introduced in 9f44780 but seems
to have been accidentally dropped during the major drivers refactoring.
We can make sure the value is enforced by pluming it through the DriverHandler,
which now uses the lesser of the task::killTimeout or client::maxKillTimeout.
Also updates Event.SetKillTimeout to require both the task.killTimeout and
client.maxKillTimeout so that we don't make the mistake of using the wrong
value - as it was being given only the task.killTimeout before.
Fixes #10005