Skip to content

OptimizedNodeBridge waitForAvailableWorker uses fixed 5s queue timeout #99

@bbopen

Description

@bbopen

Problem

waitForAvailableWorker() uses a hard-coded 5s timeout. When the pool is saturated and legitimate requests run longer than 5s, callers fail with Timeout waiting for available worker even though timeoutMs is higher. This produces false negatives and inconsistent timeout behavior.

Evidence

  • src/runtime/optimized-node.ts: waitForAvailableWorker(timeoutMs: number = 5000) has a fixed default unrelated to options.timeoutMs.

Acceptance criteria

  • Make queue wait timeout configurable (e.g., queueWaitTimeoutMs) or default it to options.timeoutMs.
  • Document how queue wait timeout interacts with per-call timeoutMs.
  • Add a test that simulates pool saturation with a long-running call and ensures the queue wait does not fail early by default.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions