Repository navigation
fix: reserve long-poll capacity for worker startup - #26751
1aifanatic wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b964685f-8bfc-4361-9bea-2103f05a7e27
📒 Files selected for processing (8)
docs/site/content/docs/remote-servers.mdxsrc/main/runtime/runtime-rpc-browser-host-admission.test.tssrc/main/runtime/runtime-rpc-check-admission.test.tssrc/main/runtime/runtime-rpc-long-poll-transport.test.tssrc/main/runtime/runtime-rpc-websocket-long-poll-caps.test.tssrc/main/runtime/runtime-rpc/runtime-rpc-long-poll.tssrc/main/runtime/runtime-rpc/runtime-rpc-request-admission.tssrc/main/runtime/runtime-rpc/runtime-rpc-state.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
|
I'm hitting this on Orca 1.4.218 on macOS. We had about 43 concurrent I tested this head and its base on a Linux test box. All 33 focused tests passed. The broader relevant suites passed 463 tests on the head and 455 on the base. Both Node server builds passed. With 40 check attempts at the default cap, the base held 16 and refused worker-start. This branch held 8 and rejected the other 32 checks. Worker-start reached its handler, and a settings mutation succeeded. The startup probe returned I found a problem with the larger setting. With Could we preserve connection headroom when the configured pool grows and add a test using separate client sockets? Otherwise, raising the cap to fit a host like mine recreates the starvation at the transport limit. I also confirmed that 0, -1, 1.5, NaN, Infinity, and an unsafe integer fall back to 16. A cap of 1 still lets one check block worker-start. I agree with the existing request to define that minimum. The default class reservation addresses the failure we saw. |
|
@1aifanatic happy to help with both pieces if it's useful. I can send the separate-client-socket test I used (40 checks on their own sockets, then worker-start and a settings mutation), and a small clamp so |
|
Fixed the separate-client transport ceiling in 49364a5. The local connection limit now grows to twice the configured poll pool, bounded at 256 connections; invalid values retain the default and positive limits clamp to 2-128. The regression uses 40 separate Windows named-pipe clients at cap 64: 32 checks keep waiting, eight receive runtime_busy, and fresh worker-start, settings, and nonblocking-check clients reach dispatch. Closing clients releases all 32 waits. The handlers are inert, so this verifies admission and cleanup rather than a complete agent launch. All 42 focused tests and the changed-code quality gate pass. |
ELI5
Repeated waiting checks can no longer fill every request slot and block worker startup. Capacity errors now say how many slots are occupied, and server operators can configure the total limit.
What Changed
Waiting orchestration checks have a separate limit of half the long-poll pool. Checks, questions and browser hosts together may use three quarters, preserving space for worker startup and other waits. Socket and WebSocket requests share these counters and release them on completion or disconnect.
The server reads ORCA_RPC_LONG_POLL_CAP at construction, accepting positive safe integers and otherwise retaining the default of 16. An explicit server option takes precedence. Existing runtime_busy errors include total and per-class occupancy; the remote-server guide documents the setting.
Why
Increasing the global limit alone would let persistent checks fill the larger pool again. Extending the existing admission limits reserves launch capacity while preserving the current retry error code and transport behavior.
Linked Issue
Fixes #19342
Visual Proof
N/A - server request admission and diagnostic text only; no rendered UI change.
Testing
Windows, Node 24.21.0, ORCA_BACKGROUND_LAUNCH=1: all 33 tests pass across runtime-rpc-check-admission, runtime-rpc-browser-host-admission, runtime-rpc-websocket-long-poll-caps and runtime-rpc-long-poll-transport suites. Coverage includes mixed check/question/browser occupancy with launch capacity remaining, invalid configuration, explicit-option precedence, overflow diagnostics, and socket disconnect cleanup.
Formatting, git diff --check and check:code-quality:changed pass. Full lint/typecheck/build and live macOS/Linux/SSH testing remain unverified locally due to native toolchain and resource limitations.
AI Disclosure
GPT-6 was used to investigate, implement, test and review this change.
Review
Limits remain owned by the execution host and shared across transports. No request schema, stream opcode, dependency, shell command or path changes. Older clients receive the existing runtime_busy error code with more detailed text.
Agent skill upstream boundary
Notes
Limits round down with a minimum of one slot; a total cap of one cannot reserve separate capacity. Raising the total limit increases permitted concurrent waits and should reflect the server workload. This adds occupancy diagnostics to errors, not a new metrics endpoint.
Author
X: @1aifanatic
Checklist
Review follow-up: both environment and explicit pool limits now normalize to 2-128. Local transport capacity grows to max(32, twice the pool), bounded at 256 connections. All 42 tests across six suites pass, including 40 separate Windows named-pipe clients at cap 64 with startup/settings/nonblocking admission and cleanup. Dispatch handlers are inert; no complete agent launch is claimed. Changed-code quality gate passes.
Merged main 099afc8 in 920b127, preserving both Node-runtime test-list additions and the newer launch classification. All 46 tests across six suites and the changed-code quality gate pass on the merged branch.