Skip to content

fix(box): allow nsjail to clean up cgroups on timeout - #190

Merged
BiFangKNT merged 1 commit into
mainfrom
fix/nsjail-timeout-cleanup
Oct 23, 2026
Merged

BiFangKNT merged 1 commit into
mainfrom
fix/nsjail-timeout-cleanup

Conversation

@BiFangKNT

Copy link
Copy Markdown
Member

Summary

Timed-out nsjail executions previously killed the supervisor immediately, leaving empty cgroup directories behind. Reuse the existing termination helper to send SIGTERM and allow child reaping and cgroup cleanup, escalating to SIGKILL after two seconds if necessary. Timeout result semantics remain unchanged.

Extend regression coverage to verify graceful termination for both timeouts and cancellation.

Validation

  • The new timeout regression fails against the original implementation.
  • All 31 nsjail unit tests pass in Linux Docker.
  • Real Docker tests on both Bookworm and Trixie verify memory OOM enforcement, PID limits, CPU quotas, timeout recovery, and session cleanup. Neither image leaves processes or cgroup directories after the fix.

Reuse graceful termination before escalating to SIGKILL so nsjail can
reap child processes and remove their cgroups.

Add regression coverage for timeout and cancellation cleanup.
@BiFangKNT
BiFangKNT merged commit d62cb06 into main Oct 23, 2026
8 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant