Skip to content

Fix Java OOM by registering kill as TeardownFunc#292

Merged
andy1li merged 3 commits into
mainfrom
andy/RegisterTeardownFunc-kill
May 26, 2026
Merged

Fix Java OOM by registering kill as TeardownFunc#292
andy1li merged 3 commits into
mainfrom
andy/RegisterTeardownFunc-kill

Conversation

@andy1li

@andy1li andy1li commented May 26, 2026

Copy link
Copy Markdown
Member

Note

Medium Risk
Changes process lifecycle and SIGKILL teardown for all shell-based tests; behavior is intentional but affects every stage using ShellExecutable on Linux.

Overview
Shell test harnesses now tear down PTY child processes reliably by wiring cleanup that was previously left as a TODO.

NewShellExecutable registers Kill() on stage teardown so the spawned program (and its children) are stopped when a test stage finishes. Kill() is a no-op if nothing was started; otherwise it stops the memory monitor, then sends SIGKILL to the process group and the leader PID—matching the existing OOM kill path for creack/pty session leaders so JVMs and other subprocesses do not keep running and skew memory limits (e.g. Java OOM scenarios).

Reviewed by Cursor Bugbot for commit 3d028cc. Bugbot is set up for automated code reviews on this repo. Configure here.

@andy1li andy1li self-assigned this May 26, 2026
Comment thread internal/shell_executable/shell_executable.go

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8cdade5. Configure here.

Comment thread internal/shell_executable/shell_executable.go
@andy1li andy1li force-pushed the andy/RegisterTeardownFunc-kill branch from 6df155e to 3d028cc Compare May 26, 2026 05:27
@andy1li andy1li merged commit d01960f into main May 26, 2026
7 checks passed
@andy1li

andy1li commented May 26, 2026

Copy link
Copy Markdown
Member Author

Thanks to @CaseyMcGuire and @mathilch for highlighting the issue!

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