Skip to content

Treat runtime queue saturation as backpressure, not target failure - #36

Merged
data-angel merged 3 commits into
mainfrom
fix/queue-backpressure-not-failure
Sep 27, 2026
Merged

data-angel merged 3 commits into
mainfrom
fix/queue-backpressure-not-failure

Conversation

@data-angel

Copy link
Copy Markdown
Contributor

Summary

  • A runtime queue that is full or timed out (RUNTIME_QUEUE_FULL / RUNTIME_QUEUE_TIMEOUT) is load, not a broken target. The failover path now releases the target probe instead of recording a target failure, so busy nodes are not marked unhealthy.
  • Upstream JSON error codes are parsed and relayed, so queue saturation keeps its own code across federated hops instead of collapsing to upstream_error.

Test plan

  • node test/model-failover.test.mjs
  • node --test test/runtime-queue.test.mjs test/federated-priority.test.mjs
  • eslint + prettier on touched files

🤖 Generated with Claude Code

data-angel and others added 3 commits September 25, 2026 13:30
A queue-timeout or queue-full 429 (from this gateway's runtime queue or
relayed by a federated node) opened the per-target circuit breaker. While
it was open, or while its single half-open probe sat in the same queue,
every other caller was fast-failed as "temporarily unavailable" even
though the model was healthy and merely busy. Entities sharing one local
model lost turns to this cascade.

Recognize RUNTIME_QUEUE_TIMEOUT / RUNTIME_QUEUE_FULL (including the code
carried in a federated upstream's error body) and release the probe
instead of recording a target failure. Failover to a next member is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A relaying gateway rewrote a federated node's RUNTIME_QUEUE_* error body to
the generic 'upstream_error', so the breaker exemption survived only one
hop. Keep the queue code on the relayed error; its response body and
Retry-After then carry backpressure to every downstream gateway and client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@data-angel
data-angel merged commit 9e04a71 into main Sep 27, 2026
2 checks passed
@data-angel
data-angel deleted the fix/queue-backpressure-not-failure branch September 27, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant