Repository navigation
Conversation
839285e to
c92b0ac
Compare
There was a problem hiding this comment.
🟡 Changes recommended
PID reuse can kill unrelated processes, failure paths can still hang indefinitely, and the regression test does not exercise rootless operation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds process-group cleanup for hung containers using NoProcessSandbox.
Changes:
- Records run/exec process IDs and kills surviving process groups.
- Adds cancellation coverage for run and exec paths.
File summaries
| File | Description |
|---|---|
executor/runcexecutor/executor.go |
Implements process-group termination. |
executor/runcexecutor/executor_linux.go |
Enables PID files in no-sandbox mode. |
worker/runc/runc_test.go |
Adds cancellation regression coverage. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Hi, is this still being worked on? It would be very useful to me. Happy to help if needed. |
|
Would there be any negative if, instead of only doing this with |
c92b0ac to
b0bdaa7
Compare
none that i found, exec leaked the same way with the sandbox so it kills the group in both modes now. run already gets that from the pid namespace |
|
friendly ping @AkihiroSuda @jsternberg |
b0bdaa7 to
fcb0861
Compare
|
needs rebasing |
fcb0861 to
80fa839
Compare
|
rebased |
Signed-off-by: Danny Hershko Shemesh <danny@wiz.io>
80fa839 to
323ce2c
Compare
|
pushed a fix for a race in the cleanup, could someone approve the ci runs on the new head? |


When a step is cancelled, buildkit SIGKILLs only the process it started:
runc killfor a run, the exec'd pid for an exec. Its subprocesses can survive and keep the IO open, so runc never returns and the solve hangs. Under --oci-worker-no-process-sandbox the container shares the host pid namespace, and rootless runc can't enumerate the survivors without cgroups (opencontainers/runc#4398). An exec leaks the same way with the sandbox, since its children stay in the container's pid namespace. See #4483 and #2855.The fix SIGKILLs the process group, since runc makes the process a session leader. Exec always kills the group first, and signals the pid only when there is no group. Run does this under NoProcessSandbox, which now passes a pidfile to
runc run, before the usualrunc kill, then also kills every process left in the init's mount namespace, pinned as soon as runc writes the pidfile, so a process that called setsid goes too. A SIGKILL sent by the client takes the same path.