Skip to content

fix(server): keep PR-status lookups for ten minutes, not one (fork patch on nightly 2819, board #15036) - #4

Open
MattRiddell wants to merge 1 commit into
live/v0.0.46-nightly.20261008.2819from
fix/15036-pr-status-cache-10min
Open

MattRiddell wants to merge 1 commit into
live/v0.0.46-nightly.20261008.2819from
fix/15036-pr-status-cache-10min

Conversation

@MattRiddell

Copy link
Copy Markdown
Owner

Board pingdotgg#15036. Matt, q3440 (Telegram 2026-10-10T00:17:56Z, "q3440: 1"): "Patch our T3 fork: PR-status caches from about 1 min to 10 min; re-apply on each T3 upgrade; PR badges can lag up to 10 min".

What

  • GitManager: PR_LOOKUP_CACHE_TTL 60 s → 10 min; PR_LOOKUP_NO_OPEN_PR_CACHE_TTL 5 min → 10 min. Refresh paths (turn end, push, create PR, user refresh) still bypass the cache. Failure backoff is unchanged.
  • PullRequestReadCache: entries and scope invalidations last ENTRY_TTL (10 min), not 60 s. An invalidation still outlives any entry read before it.

Why

On live nightly 2819, the trace shows 204 GitHubApi.send calls in 16.6 min (about 740 an hour), all from the one-minute sweeps:

  • 95 listPullRequestsByHead from ThreadPullRequestServiceV2.synchronize
  • 56 listPullRequestsByHead from ThreadSettlementServiceV2.sweep
  • 56 getPullRequestSummary from PullRequestReadCache.get (settlement sweep 42 + sync reactor 14)

Baseline before T3 called GitHub itself: 1,414 a day.

Tests

  • vp test run src/pullRequest/PullRequestReadCache.test.ts src/git/GitManager.test.ts: 130 passed, 2 failed. The 2 failures are the commit-hook tests ("emits ordered progress events for commit hooks", "emits action_failed when a commit hook rejects"). They fail the same way on the unpatched tag on this host, so the patch does not cause them.
  • Must-fail control: the new "ten minutes" tests fail against the unpatched source.
  • tsc --noEmit (apps/server): clean.

Build

t3-patched-build against the live install ~/.local/lib/t3-20261008-2819: VERDICT=PATCH-ONLY changed_lines=12, staged at ~/.local/lib/t3-20261008-2819-pr10m (sha256 19dd53abca631526…), boot smoke 200. The live switch is a controller drop-in that takes effect at Matt's next restart.

🤖 Generated with Claude Code

…tch, board pingdotgg#15036)

The settlement and thread-PR sweeps run every minute and re-read every
open PR from GitHub once their one-minute cache entries expire: 500 to
1,100 GraphQL calls an hour on the fleet box (listPullRequestsByHead from
ThreadPullRequestServiceV2.synchronize and ThreadSettlementServiceV2.sweep,
getPullRequestSummary from PullRequestReadCache).

- GitManager: PR_LOOKUP_CACHE_TTL 60 s -> 10 min; the no-open-PR TTL
  5 min -> 10 min. Refresh paths (turn end, push, create PR, user refresh)
  still bypass the cache; failure backoff is unchanged.
- PullRequestReadCache: entries and scope invalidations last ENTRY_TTL
  (10 min) instead of 60 s, so an invalidation still outlives any entry
  read before it.

PR badges and external merges can lag up to ten minutes. Matt, q3440
(Telegram 2026-10-10T00:17:56Z): "q3440: 1".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant