Skip to content

fix(orchestrator): bound destructor collection handoff - #489

Open
LukeMathWalker wants to merge 3 commits into
refactor/orchestrator-explicit-detachfrom
fix/orchestrator-bounded-drop-collector
Open

fix(orchestrator): bound destructor collection handoff#489
LukeMathWalker wants to merge 3 commits into
refactor/orchestrator-explicit-detachfrom
fix/orchestrator-bounded-drop-collector

Conversation

@LukeMathWalker

@LukeMathWalker LukeMathWalker commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Why

Destructor fallbacks could create a reaper thread and then call an unbounded Child::wait if thread creation failed. Under resource exhaustion, dropping an orchestration guard could therefore wedge the process indefinitely.

What Changed

  • initialize one persistent collector before any managed child is spawned
  • transfer destructor-owned children through a non-blocking channel handoff
  • multiplex long-lived and short-lived children in the collector worker
  • preserve Windows Job Object capabilities while collection is pending
  • cover collector multiplexing with a long-lived-child integration test

Risks / Notes

Explicit rollback may still wait while returning a cleanup error; destructor paths only hard-signal and enqueue. If the pre-initialized worker disconnects unexpectedly, Drop deliberately retains the rejected capabilities until process exit rather than blocking or releasing Windows Job authority. Raw fork-without-exec reuse of the library is outside its supported contract. This PR fixes the high-severity review finding on the lifecycle-ownership stack and targets #488.

AI Assistance

Implementation assisted by OpenAI GPT-5.4.

@LukeMathWalker
LukeMathWalker force-pushed the fix/orchestrator-bounded-drop-collector branch from 733346d to 9e265ce Compare August 10, 2026 06:42
@LukeMathWalker
LukeMathWalker force-pushed the fix/orchestrator-bounded-drop-collector branch 2 times, most recently from 21084bb to fec1f45 Compare August 10, 2026 07:01
@LukeMathWalker
LukeMathWalker force-pushed the fix/orchestrator-bounded-drop-collector branch from fec1f45 to e1259ab Compare August 10, 2026 08:43
@LukeMathWalker
LukeMathWalker force-pushed the fix/orchestrator-bounded-drop-collector branch from e1259ab to 352aaf1 Compare August 10, 2026 14:59
@LukeMathWalker
LukeMathWalker marked this pull request as ready for review August 10, 2026 15:16
@LukeMathWalker
LukeMathWalker added this pull request to the merge queue Aug 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue because the pull requests in the stack were not ordered correctly in the queue Aug 10, 2026
@LukeMathWalker
LukeMathWalker force-pushed the fix/orchestrator-bounded-drop-collector branch from 352aaf1 to 55b03e8 Compare August 10, 2026 15:21
@LukeMathWalker
LukeMathWalker force-pushed the fix/orchestrator-bounded-drop-collector branch from 55b03e8 to 1e86995 Compare August 10, 2026 16:33
@LukeMathWalker
LukeMathWalker force-pushed the fix/orchestrator-bounded-drop-collector branch from 1e86995 to 4a3280c Compare August 10, 2026 16:57
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