feat: add abort-driven subprocess lifecycle#141
Open
V3RON wants to merge 3 commits into
Open
Conversation
Propagate abort signals through app sessions and replace global subprocess cleanup with explicit termination.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Resolve conflicts and keep the latest changes from main.
Prevent release from racing an in-flight heartbeat write, and align the signal-flow test with the completed-run exit code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this?
This PR replaces global subprocess shutdown hooks with explicit, abort-driven lifecycle control. Harness sessions now own shutdown state, and platform app sessions receive an
AbortSignalso subprocesses stop with the session instead of lingering across restarts or process exit.How does it work?
The core subprocess helper now exposes explicit termination: it sends
SIGTERMfirst, waits for exit, and escalates toSIGKILLif the process does not stop in time. At the harness layer, a session-scopedAbortControlleris passed through app session creation and plugin setup, and platform implementations forward that signal to the underlying app, log, and device processes they spawn.The new contract is wired through Android, iOS, Web, and Vega runners so the lifecycle shape stays consistent across platforms. Tests cover signal propagation, session teardown, and subprocess shutdown behavior.
Why is this useful?
processsignal listeners andprocess.exitside effects from subprocess cleanup.