Skip to content

test: probe runtime cancellation and process ownership - #14

Merged
skevetter merged 4 commits into
mainfrom
codex/runtime-process-cleanup
Oct 3, 2026
Merged

skevetter merged 4 commits into
mainfrom
codex/runtime-process-cleanup

Conversation

@skevetter

@skevetter skevetter commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

The next host-hardening spike exercises real host/plugin/runtime-child ownership through the SDK's go-plugin/gRPC transport. The fixture launches a blocking child, acknowledges readiness before cancellation, answers independent liveness probes, and reports reaping only after exec.Cmd.Wait returns.

The probes record two ownership gaps that must be resolved before runtime cutover:

  • Abrupt plugin death leaves the runtime child running.
  • Abrupt host death cancels the RPC and lets a cooperative plugin reap its child, but leaves the plugin serving.

Unary and Exec cancellation both reap the fixture child, including a child that ignores interruption. Unix asserts that the child received and ignored the signal before forced termination. Windows exercises the bounded forced-kill fallback because Go cannot deliver os.Interrupt to its child process there.

Surviving processes are independently killed by the test observer, with retained process handles, and crash-left socket files are isolated in a short private temporary directory. The README explains the results and their limits. No public supervisor API or host lifetime policy is introduced; passing these tests records the transport's current gaps rather than certifying abrupt process-tree cleanup.

CI keeps the existing Linux/macOS/Windows race-test matrix and publishes runtime-tests-* JSON artifacts for reviewable platform evidence. Bash pipe failure propagation preserves test failures when teeing the report.

Local validation: full SDK race tests, vet, strict lint, prek, and diff checks passed. Local CodeRabbit identified an observer teardown backpressure issue; the fix was re-reviewed with zero findings. The last successful fresh committed review covered all six files with zero findings. A small event-routing extraction then brought the reader back within strict complexity limits; its final fresh CodeRabbit rerun was rate-limited (49-minute reset). The final source is validated with race tests, vet, and prek; the uncommitted workspace check is clean.

CI validation: run 37130756350 passed all three platform race/vet jobs, all startup probes, generated bindings, Lint, and Pre-commit. The saved JSON reports confirm all four cancellation combinations and both ownership-gap scenarios on Linux, macOS, and Windows. Release Please was skipped as expected for a pull request.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d80ad93e-2946-480e-bc54-f5eebcdb639b
📥 Commits

Reviewing files that changed from the base of the PR and between c646785 and de4c11e.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • README.md
  • internal/processfixture/main.go
  • internal/processfixture/observer.go
  • internal/processprobe/observer_test.go
  • internal/processprobe/process_test.go
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@skevetter
skevetter marked this pull request as ready for review October 3, 2026 14:51
@skevetter
skevetter merged commit 06cd39c into main Oct 3, 2026
11 checks passed
@skevetter
skevetter deleted the codex/runtime-process-cleanup branch October 3, 2026 14:51
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.

1 participant