Restore runc kill all behavior for init processes#2573
Merged
helsaawy merged 2 commits intomicrosoft:mainfrom Dec 17, 2025
Merged
Restore runc kill all behavior for init processes#2573helsaawy merged 2 commits intomicrosoft:mainfrom
helsaawy merged 2 commits intomicrosoft:mainfrom
Conversation
anmaxvl
approved these changes
Dec 10, 2025
apurv15
reviewed
Dec 11, 2025
3cb373f to
86d6721
Compare
rawahars
approved these changes
Dec 16, 2025
PR microsoft#2538 removed the `runc kill --all` flag, when signaling containers. However, when cleaning up after the init process exists, the `--all` flag is still needed to remove any potentially orphaned processes when using runc before v1.2. See: opencontainers/runc@f8ad20f#diff-ade6035c3e554d7627cdc368b27f475fc0dad83e02382a1dea9cae9b75871087 Additionally, switch to using error strings directly from runc code in `internal\guest\runtime\runc\utils.go`: they have been available since runc v1.1.0-rc.1. See: opencontainers/runc#3033 Also, add logic to match on container not/still running error strings and return them for `Kill`, since returning `ERROR_VMCOMPUTE_SYSTEM_ALREADY_STOPPED` (`0xc0370110`) when killing a stopped container is expected behavior and handled appropriately in `"cmd/containerd-shim-runhcs-v1".(*hcsExec).Kill()`. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
Fix lint errors (introduced by go1.24): ``` printf: non-constant format string in call to github.com/pkg/errors.Wrapf (govet) ``` Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
86d6721 to
fc06d3a
Compare
anmaxvl
approved these changes
Dec 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #2538 removed the
runc kill --allflag, when signaling containers.However, when cleaning up after the
initprocess exists, the--allflag is still needed to remove any potentially orphaned processes when using runc before v1.2.See: opencontainers/runc@f8ad20f#diff-ade6035c3e554d7627cdc368b27f475fc0dad83e02382a1dea9cae9b75871087
Additionally, switch to using error strings directly from runc code in
internal\guest\runtime\runc\utils.go: they have been available sincerunc v1.1.0-rc.1.
See: opencontainers/runc#3033
Also, add logic to match on container not/still running error strings and return them for
Kill, since returningERROR_VMCOMPUTE_SYSTEM_ALREADY_STOPPED(0xc0370110) when killing a stopped container is expected behavior and handled appropriately in"cmd/containerd-shim-runhcs-v1".(*hcsExec).Kill().Note
Core changes are in the first commit, second is the
go mod tidyandvendorand linter changes