Repository navigation
chore(fork): carry the settled-pr-lookups patch - #180
Conversation
The settlement sweep re-spawns git for every closed or merged PR lookup each minute, and those spawns block the server's main thread. Carry upstream pingdotgg#29721 until it lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
fireboltdude1357
left a comment
There was a problem hiding this comment.
Manual review round 1: crev (claude-opus-5-5 + gpt-6.1-sol) (tier 7/10, deep review)
No verified findings.
Reviewed 1 files (+1 -0), 95339cee..7b2946ca against origin/patch/release.
Uncertain: the verifier could not decide (1)
.github/fork-patches.txt:29Settled PR fingerprint may skip the remote-tracking-ref ambiguity check for deleted branches [minor]: I couldn't read the patch's code. This diff only adds the list line; thepatch/settled-pr-lookupscode isn't in this tree or any checked-out worktree I could find, and Bash/git was denied. What the base code shows:- apps/server/src/git/GitManager.ts:2515-2547: when the local branch is gone, it lists
refs/remotesand throws "Multiple remotes track ${branch}. Its pull request is ambiguous." when more than one remote has the branch. - GitManager.ts:2381-2396 and line 173: these git reads are kept for
PR_LOOKUP_GIT_STATE_TTL(5 minutes) unlessfreshis set. - GitManager.ts:2644-2648:
branchPullRequestreruns the lookup withfreshGitState: truewhenever the result isn't open. So before this patch, a closed or merged result always rereads the tracking refs, and the ambiguity in the trigger gets caught. The trigger is not reachable in the base code. - The PR description says the patch replaces that full lookup with "a 2-process fingerprint of the branch and its remotes", which fits the claim but doesn't prove it. A single
for-each-ref refs/heads/<b> refs/remotes/*/<b>call would cover tracking refs within 2 processes.
To settle it, rungit show origin/patch/settled-pr-lookups:apps/server/src/git/GitManager.tsand check whether the settled fingerprint includesrefs/remotes/*/<branch>(or the fullrefs/remoteslisting) when the local branch doesn't exist.
Tier 7/10 from claude-opus-5-5: Adds a patch to the fleet build list: PR-state caching code that background auto-settle acts on, on every fork server. Stale caching could fail quietly.
Complexity medium: The diff is one config line, but it pulls in upstream caching and fingerprint logic for PR-state lookups. That logic is hard to get right.
Problem
The stl-wsl server has been slow again. A 20-minute CPU profile of the live server showed the main thread spent 272 s inside
spawn. That's 48% of its busy time. Each spawn blocks the event loop while the kernel copies the ~900 MB server process, and the server ran about 7,150 of them in those 20 minutes. The settlement sweep started about 59% of them. When the cached PR for a branch is closed or merged, the sweep reruns the whole git lookup every minute.Change
Adds
settled-pr-lookups patch/settled-pr-lookups pingdotgg/t3code#29721to.github/fork-patches.txt.patch/settled-pr-lookupsis the head of upstream pingdotgg#29721 (ca5698a) with nothing added. That PR is from Julius. Once a fresh lookup confirms a PR is closed or merged, later sweeps check a 2-process fingerprint of the branch and its remotes instead of the ~6-process lookup, and still do a full fresh lookup at most every 15 minutes. CodeRabbit and Macroscope reviewed it upstream, and its CI is green. Drop this line when pingdotgg#29721 merges.Verification
node scripts/fork-sync.ts --force --patch-list <this list> --workdir /tmp/fork-sync-splmerges every patch onto upstreamcefb544af3and builds0.1.7-nightly.20261103.411901(853af108ff). The only warning is the existingwal-pinned-writesone.vp test run apps/server/src/git/GitManager.test.tspasses 116 of 116, including the PR's new cases, and the server typecheck passes.Review tier: 7/10, changes PR-state caching that background auto-settle acts on
Two-way door: removing the line drops the patch from the next build
Blast radius: PR status and auto-settle on every fork server
Written by Claude Opus 5.5 in Claude Code, running in T3 Code.
🤖 Generated with Claude Code