fix(app): keep slow git reads from filling the request queue - #47564
Merged
Conversation
Hona
force-pushed
the
request-queue-lanes
branch
from
September 6, 2026 05:14
09b60b5 to
0f37132
Compare
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.
The request queue from #47441 is a plain FIFO with 4 slots. A Desktop netlog shows what sits in those slots during a session-tab mount:
GET /api/vcsGET /api/worktreeGET /api/session/:id,/message,/permission,/form, catalogsA mount fires ~21 requests; two of them run
gitand can hold slots for over two seconds each. With several tabs mounting or a reconnect re-syncing directories, git reads take all 4 slots and the reads that actually paint the session sit behind them — which is exactly whatserver thrashing detectedwas logging (inflight: [GET /api/worktree…, GET /api/worktree…],queued: [GET /api/health]).flowchart LR subgraph before [Before: FIFO x4] B[vcs · vcs · worktree · worktree] --> Q[queued: session, messages, permissions…] end subgraph after [After: slow share = 2 of 4] A1[vcs · vcs] --- A2[session · messages · …] A3[worktree · worktree] -.waits for a slow slot.-> A1 endChange —
packages/app/src/runtime/server/request-queue.tsslowRequestPaths = ["/api/vcs", "/api/worktree"](prefix match, so/api/vcs/diff,/api/vcs/branchesincluded);requestQueueSlowLimit = 2.Total concurrency is unchanged (4 + the event stream), so the Chromium per-origin limit reasoning in #47441 still holds.