Skip to content

Added stop signal to container termination logic and container status#11774

Merged
mikebrow merged 1 commit intocontainerd:mainfrom
sreeram-venkitesh:kep-4960-container-stop-signals
Apr 28, 2026
Merged

Added stop signal to container termination logic and container status#11774
mikebrow merged 1 commit intocontainerd:mainfrom
sreeram-venkitesh:kep-4960-container-stop-signals

Conversation

@sreeram-venkitesh
Copy link
Copy Markdown
Contributor

PR for #11617. Tests would fail since cri-api is not bumped to the latest version which has the API changes for stop signals in ContainerConfig and ContainerStatus.

Waiting for #11763 to be merged so that I can rebase the cri-api update into this PR.

@k8s-ci-robot
Copy link
Copy Markdown

Hi @sreeram-venkitesh. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@chrishenzie
Copy link
Copy Markdown
Member

Waiting for #11763 to be merged so that I can rebase the cri-api update into this PR.

Left a comment on that PR. Unfortunately this is blocked until we can remove the go1.24 requirement from the CRI API module.

@sreeram-venkitesh
Copy link
Copy Markdown
Contributor Author

Rebased with the cri-api bump. I'll resume working on this PR again now. I need to add tests.

@sreeram-venkitesh sreeram-venkitesh force-pushed the kep-4960-container-stop-signals branch 2 times, most recently from 9c69bdc to 7707926 Compare May 28, 2025 11:01
@sreeram-venkitesh sreeram-venkitesh changed the title [WIP] Added stop signal to container termination logic and container status Added stop signal to container termination logic and container status Oct 1, 2025
@sreeram-venkitesh sreeram-venkitesh force-pushed the kep-4960-container-stop-signals branch from 7707926 to a634070 Compare October 1, 2025 09:15
@fuweid
Copy link
Copy Markdown
Member

fuweid commented Oct 30, 2025

@sreeram-venkitesh could you please rebase that change? thanks

@sreeram-venkitesh sreeram-venkitesh force-pushed the kep-4960-container-stop-signals branch from a634070 to ae630fc Compare January 6, 2026 11:12
@mikebrow mikebrow force-pushed the kep-4960-container-stop-signals branch 2 times, most recently from 8f670c5 to a8f0823 Compare January 20, 2026 23:07
@sreeram-venkitesh sreeram-venkitesh force-pushed the kep-4960-container-stop-signals branch 2 times, most recently from f37ab4d to e989d97 Compare February 2, 2026 06:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/cri/server/container_status_test.go
@sreeram-venkitesh
Copy link
Copy Markdown
Contributor Author

@mikebrow The tests are all passing finally! Copilot has reviewed the code too, I'm taking a look..

@fuweid
Copy link
Copy Markdown
Member

fuweid commented Apr 24, 2026

Any update on this change?

@fuweid
Copy link
Copy Markdown
Member

fuweid commented Apr 24, 2026

I can take over this if need.

@mikebrow
Copy link
Copy Markdown
Member

mikebrow commented Apr 24, 2026

nod let's help push this through.. just needs a gofmt, rebase, and if you have any issues you'd like to address @fuweid

@mikebrow
Copy link
Copy Markdown
Member

mikebrow commented Apr 24, 2026

a lot of commits could you also squash pls.. at least the last one :) though some maintainers like to thin it down to standalone features that could be cherry picked individually.

Copilot AI review requested due to automatic review settings April 24, 2026 22:50
@fuweid fuweid force-pushed the kep-4960-container-stop-signals branch from d6de978 to 625e7be Compare April 24, 2026 22:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +128 to +139
var statusStopSignal runtime.Signal
stopsignal := container.Config.GetStopSignal()

if stopsignal == runtime.Signal_RUNTIME_DEFAULT {
if container.Metadata.StopSignal != "" {
statusStopSignal = toCRISignal(container.Metadata.StopSignal)
} else {
statusStopSignal = runtime.Signal_SIGTERM
}
} else {
statusStopSignal = stopsignal
}
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

toCRIContainerStatus uses toCRISignal(container.Metadata.StopSignal) whenever Metadata.StopSignal is non-empty. If the stored stop signal is something moby/sys/signal.ParseSignal accepts (e.g., TERM or a numeric value like 15 from an image config) but toCRISignal doesn’t recognize it, the status will end up reporting RUNTIME_DEFAULT instead of a concrete signal (or the default SIGTERM). Consider normalizing/validating the string (trim optional SIG prefix, uppercase, handle numeric via signal.ParseSignal) and/or falling back to SIGTERM when conversion fails.

Copilot uses AI. Check for mistakes.
Comment thread integration/container_stop_signal_test.go
Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

@fuweid fuweid force-pushed the kep-4960-container-stop-signals branch from 625e7be to a89225c Compare April 25, 2026 00:00
@fuweid
Copy link
Copy Markdown
Member

fuweid commented Apr 25, 2026

kindly ping @dmcgowan @samuelkarp for approval

@mikebrow mikebrow added this to the 2.3 milestone Apr 25, 2026
@mikebrow mikebrow moved this from Needs Triage to Review In Progress in Pull Request Review Apr 25, 2026
Copilot AI review requested due to automatic review settings April 26, 2026 14:18
@mikebrow mikebrow force-pushed the kep-4960-container-stop-signals branch from a89225c to ef09699 Compare April 26, 2026 14:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/cri/server/container_stop_signal.go
@mikebrow mikebrow force-pushed the kep-4960-container-stop-signals branch from ef09699 to 1b1aba4 Compare April 27, 2026 12:52
@mxpv mxpv added this pull request to the merge queue Apr 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Apr 27, 2026
@mikebrow mikebrow added this pull request to the merge queue Apr 27, 2026
Merged via the queue into containerd:main with commit d8e7c71 Apr 28, 2026
94 of 96 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Apr 28, 2026
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.

10 participants