mirror of
https://github.com/stablyai/orca.git
synced 2026-10-22 16:03:47 +00:00
fix(orchestration): treat ask as a long-poll so it survives the 30s socket idle wall (#9351)
orchestration.ask blocks server-side until a reply lands or its timeout
(default 600s) elapses, holding the RPC open — but isLongPollRequest never
classified it as a long-poll. So the keepalive that resets the 30s
RUNTIME_RPC_SOCKET_IDLE_TIMEOUT_MS was never armed, and any ask left
unanswered for 30s died with a misleading runtime_unavailable ("The Orca
runtime closed the connection"), regardless of --timeout-ms. The same
omission left the handler's abort signal unwired (it is only passed for
long-polls), so the client-disconnect release path guarded by
signal?.aborted was dead code.
Add orchestration.ask to isLongPollRequest so it gets the keepalive, the
abort signal, and long-poll admission. The client already extends its
per-call socket timeout for ask (handlers/orchestration.ts passes
timeoutMs + 5s at the call site), so only the server-side classification
was missing.
This commit is contained in:
@@ -397,6 +397,14 @@ function isLongPollRequest(request: RpcRequest): boolean {
|
||||
if (request.method === 'terminal.wait') {
|
||||
return true
|
||||
}
|
||||
// Why: orchestration.ask blocks unconditionally (default 600 s) holding the
|
||||
// RPC open until a reply lands or the deadline passes, so it needs the same
|
||||
// keepalive as check --wait or the 30 s socket idle timer tears it down. It
|
||||
// also relies on the abort signal (only wired for long-polls) to release the
|
||||
// waiter when the asking client disconnects.
|
||||
if (request.method === 'orchestration.ask') {
|
||||
return true
|
||||
}
|
||||
if (request.method === 'orchestration.check') {
|
||||
const params = request.params as { wait?: unknown } | undefined
|
||||
return params?.wait === true
|
||||
|
||||
Reference in New Issue
Block a user