-
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
OptimizedNodeBridge.init() does not guard against concurrent calls. Multiple callers can trigger overlapping init() invocations, spawning more than minProcesses and running warmups multiple times.
Failure mode
- Two callers invoke
init()concurrently. - Both loops see
processPool.length < minProcessesand spawn extra workers. - Warmup commands run multiple times.
Evidence
src/runtime/optimized-node.tsinit()has noinitPromiseguard (unlikeNodeBridge).
Proposed fix
- Add an
initPromiseguard to makeinit()idempotent and safe under concurrency. - Ensure warmup runs once per initialization.
Acceptance criteria
- Concurrent
init()calls do not overspawn workers. - Warmup commands run once.
- Add a test that calls
init()concurrently and verifies pool size.
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)