Repository navigation
Analysis gateway: a share per client when places are scarce - #574
Merged
Merged
Conversation
From the review of everything merged since #485 (spec 010 Story 6, T065). The lanes' places and waiting list were first come, first served across all clients, so one address keeping a lane and its waiting list full had everyone else refused. Now a client has at most PER_CLIENT (default 8) computations running or waiting, in all lanes; beyond that, one that would have to wait is refused, while one that finds a place free still runs -- a class or an institution behind one address is not refused by an idle service. A client is the address nginx saw (X-Real-IP, which nginx sets from the connection; the gateway listens on loopback, so only nginx can send it), and an IPv6 client its /64, any address in which it can choose. /health reports the share and how many clients are inside. Each rule shown failing its spec when mutated away: the share, the share held back while places are free, and the place given back on a timeout and on leaving. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec 010 Story 6 (
specs/010-java-services, T065). From the review of everything merged since #485.The problem. The gateway's lanes and waiting list were first come, first served across all clients. One address keeping a lane and its waiting list full (4 running, 40 waiting) got every other reader refused for as long as it kept them full.
The fix: a share per client, only when places are scarce.
PER_CLIENT(default 8) computations running or waiting, across all lanes.Retry-After), while other clients still get in.X-Real-IP. nginx sets it from the connection, and the gateway listens on loopback, so only nginx can send it. An IPv6 client is grouped by its /64, since it can pick any address in it./healthreports the share and how many clients are inside.Not included. The first draft also closed the connection after a refusal. The review showed that is unnecessary behind nginx, which sends the body whole so Node discards it. It could also cut a large refused upload mid-send and turn the 503 into nginx's own 502, so it is not part of this PR.
Checks
/healthshowsperClient: 8. AnalysisService GETs through nginx and the gateway answer as before.🤖 Generated with Claude Code