Skip to content

fix(check): stop multi check from hanging on exit after a run completes#151

Open
RobbieMcKinstry wants to merge 1 commit into
check-session-trace-archivefrom
fix-multi-check-hang-on-exit
Open

fix(check): stop multi check from hanging on exit after a run completes#151
RobbieMcKinstry wants to merge 1 commit into
check-session-trace-archivefrom
fix-multi-check-hang-on-exit

Conversation

@RobbieMcKinstry

Copy link
Copy Markdown
Contributor

Check::dispatch() only called std::process::exit on the failure path;
a successful run fell through to an implicit Runtime drop, which blocks
until every task the runtime ever spawned — ours or a dependency's — has
fully unwound. Any straggling task (e.g. deep inside cersei-agent/-provider)
could silently hold the process open after the presenter had already torn
down and printed the record, requiring Ctrl-C to exit.

Also stop discovery, execution, and reporting explicitly (mirroring
the presenter's existing stop_gracefully/wait_for_shutdown pattern) instead
of just dropping their ActorRefs — ExecutionActor's per-check background
tasks hold their own clones of those refs, so implicit ref-counted mailbox
closure was a race against those tasks finishing rather than a deterministic
signal.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

RobbieMcKinstry commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

…etes

`Check::dispatch()` only called `std::process::exit` on the failure path;
a successful run fell through to an implicit `Runtime` drop, which blocks
until every task the runtime ever spawned — ours or a dependency's — has
fully unwound. Any straggling task (e.g. deep inside cersei-agent/-provider)
could silently hold the process open after the presenter had already torn
down and printed the record, requiring Ctrl-C to exit.

Also stop `discovery`, `execution`, and `reporting` explicitly (mirroring
the presenter's existing stop_gracefully/wait_for_shutdown pattern) instead
of just dropping their ActorRefs — ExecutionActor's per-check background
tasks hold their own clones of those refs, so implicit ref-counted mailbox
closure was a race against those tasks finishing rather than a deterministic
signal.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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