Skip to content

fix(lifecycle): tolerate NotFound from Kill when process exits naturally - #9

Merged
dmcgowan merged 1 commit into
containerd:mainfrom
austinvazquez:fix/lifecycle-kill-not-found
Jul 28, 2026
Merged

fix(lifecycle): tolerate NotFound from Kill when process exits naturally#9
dmcgowan merged 1 commit into
containerd:mainfrom
austinvazquez:fix/lifecycle-kill-not-found

Conversation

@austinvazquez

@austinvazquez austinvazquez commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

The Lifecycle conformance test drives a container through
create → start → state → kill → wait → delete → shutdown and verifies
it prints expected output. After the container produces its output the
test calls Kill(SIGKILL) to clean up.

On fast runners (observed on macOS arm64 CI) the init process can exit
before the Kill RPC arrives. The shim correctly returns
NotFound / process already finished, but the test was treating any
non-nil error from Kill as a hard t.Fatal, causing a spurious
failure even though the container had completed its work successfully.

NotFound from Kill means the process is already in a terminal state
— there is nothing to kill and the remaining Wait/Delete/Shutdown
sequence still works correctly. This is a benign race, not a shim bug.

Changes

  • Tolerate NotFound from Kill in testLifecycle using
    errgrpc.ToNative + errdefs.IsNotFound (both packages are already
    direct dependencies).
  • Log the race when it occurs so it remains visible in test output.

Test plan

  • Existing shimtest suite passes on linux-x64, windows-x64, and
    macos-arm64 (the platform where this race was observed).

@austinvazquez
austinvazquez force-pushed the fix/lifecycle-kill-not-found branch 2 times, most recently from eab9df5 to 11728a9 Compare July 28, 2026 02:22
The Lifecycle test verifies a container's full create/start/kill/wait/delete
cycle. After the container prints its expected output, the test sends SIGKILL
to clean up. On fast runners (especially macOS arm64), the init process may
exit before the Kill RPC arrives, causing the shim to return NotFound ("process
already finished"). The test was treating that as a hard failure.

NotFound from Kill means the process is already in a terminal state — there is
nothing to kill and the remaining Wait/Delete/Shutdown sequence still works
correctly. Treat it as a benign race and continue rather than failing the test.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
@dmcgowan
dmcgowan force-pushed the fix/lifecycle-kill-not-found branch from 11728a9 to a4c9d3e Compare July 28, 2026 03:58
@dmcgowan
dmcgowan merged commit 4230623 into containerd:main Jul 28, 2026
6 checks passed
@austinvazquez
austinvazquez deleted the fix/lifecycle-kill-not-found branch July 28, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants