-
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
NodeBridge and OptimizedNodeBridge accept invalid timeoutMs values (NaN/negative). These flow into setTimeout and TimedOutRequestTracker.ttlMs, causing immediate timeouts or NaN TTL behavior that can drop timeout tracking and mis-handle late responses.
Failure mode
timeoutMs = NaN→setTimeoutbehaves unexpectedly;TimedOutRequestTrackerTTL becomes NaN.timeoutMs < 0→ immediate timeout (or clamped), inconsistent behavior.
Evidence
src/runtime/node.tsusestimeoutMsdirectly andMath.max(1000, timeoutMs * 2).src/runtime/optimized-node.tsusestimeoutMsdirectly insetTimeout.- Tests in
test/runtime_config.test.tsallow invalid timeouts but code does not sanitize.
Proposed fix
- Validate
timeoutMson construction: if not finite or < 0, fall back to default (30s) or clamp to 0. - Ensure
TimedOutRequestTrackeris constructed with a finite TTL.
Acceptance criteria
- Invalid
timeoutMsdoes not lead to NaN TTL or immediate unexpected timeouts. - Add tests that pass NaN/negative values and assert sanitized behavior.
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)