-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
area:runtime-nodeArea: Node runtime bridgeArea: Node runtime bridgepriority:p2Priority P2 (medium)Priority P2 (medium)
Milestone
Description
Problem
waitForAvailableWorker() uses a polling loop via setTimeout(checkWorker, 10) but does not cancel the loop when the overall queue timeout fires. If the promise rejects on timeout, the polling continues indefinitely, creating a CPU/timer leak.
Evidence
src/runtime/optimized-node.ts:waitForAvailableWorkersets an overall timeout and then recursively schedulescheckWorkerwithout a cancellation flag.
Acceptance criteria
- Stop polling when the queue timeout fires (e.g., set a flag and check it before rescheduling).
- Ensure no timers remain after the promise resolves or rejects.
- Add a test that forces queue timeout and verifies polling stops.
Metadata
Metadata
Assignees
Labels
area:runtime-nodeArea: Node runtime bridgeArea: Node runtime bridgepriority:p2Priority P2 (medium)Priority P2 (medium)