-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
area:runtime-nodeArea: Node runtime bridgeArea: Node runtime bridgebugSomething isn't workingSomething isn't workingpriority:p2Priority P2 (medium)Priority P2 (medium)
Milestone
Description
Summary
Disposing a NodeBridge while init() is in flight can leave a Python subprocess running because dispose() returns early when child is still unset, but startProcess() later assigns this.child.
Failure mode
- Trigger
bridge.init()(orbridge.call()which callsinit()), then calldispose()beforestartProcess()assignsthis.child. dispose()seeschildas undefined, exits without killing anything.startProcess()completes and leaves a live Python subprocess despitedisposed=true.
Evidence
src/runtime/node.tsininit()andstartProcess().
Proposed fix
- Add a disposal guard inside
startProcess()after spawn: ifthis.disposed, kill the child immediately and bail. - Optionally track a cancel token/promise so
dispose()can awaitstartProcess()and kill the child deterministically.
Acceptance criteria
- Disposing during init leaves no running Python subprocess.
- Subsequent calls after dispose fail with
BridgeDisposedErrorand do not leak processes. - Add a regression test that triggers dispose mid-init.
Metadata
Metadata
Assignees
Labels
area:runtime-nodeArea: Node runtime bridgeArea: Node runtime bridgebugSomething isn't workingSomething isn't workingpriority:p2Priority P2 (medium)Priority P2 (medium)