Skip to content

Conversation

dylrich
Copy link

@dylrich dylrich commented Jul 23, 2025

I wanted to start a conversation about signal handling -- I noticed that the Docker driver was sending a kill signal to the container instead of the stop command and thought it would be nice if the Podman driver did this as well. I wasn't able to run all of the tests successfully locally on clone, so I'm unsure if this breaks some other expectation.

@dylrich dylrich requested a review from a team as a code owner July 23, 2025 05:19
Copy link

hashicorp-cla-app bot commented Jul 23, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@adriaandens
Copy link
Contributor

Container stop sends the SIGTERM and SIGKILL signals after the timeout has been reached. Setting the timeout to 0 is the same as killing, if that's what you're after?

@dylrich
Copy link
Author

dylrich commented Jul 27, 2025

Without this change, my tasks are not receiving the stop signals I am configuring. I want to send e.g. SIGQUIT, not the default kill signals. When I was investigating why this was, I noticed that the docker driver does not seem to be using the equivalent of podman container stop, but rather podman container kill to send the expected kill signal. I think it makes sense to make this driver match the docker driver's behavior so signals are sent to container as expected.

@tgross tgross self-requested a review July 28, 2025 20:20
@tgross tgross moved this from Needs Triage to Triaging in Nomad - Community Issues Triage Jul 28, 2025
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @dylrich!

This would allow the task.kill_signal to be specified, which is great. But then we need to follow-up with sending SIGKILL when the task.kill_timeout expires.

Because the Podman API can't do that for us with ContainerKill, you'll need to implement that here as well. As you've noticed in your comment, that'll be similar to what we've done for the in-tree docker driver here.

return drivers.ErrTaskNotFound
}

// fixme send proper signal to container
Copy link
Member

Choose a reason for hiding this comment

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

We've fixed it now, let's remove this comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

3 participants