Skip to content

Skip a user whose data GitHub cannot return so large locations refresh again (#145) - #149

Open
tmlayton wants to merge 1 commit into
ashkulz:masterfrom
tmlayton:fix-145-skip-unloadable-user
Open

tmlayton wants to merge 1 commit into
ashkulz:masterfrom
tmlayton:fix-145-skip-unloadable-user

Conversation

@tmlayton

Copy link
Copy Markdown

Fixes #145. Refs #143.

Why United States stopped updating on 2026-08-24

One United States user's data is now too costly for GitHub to return. Every request for the page that holds them fails, either with RESOURCE_LIMITS_EXCEEDED on contributionsCollection or with a timeout body that is not JSON. SearchUsers retries the same page every time, so all ten retries hit the same user and log.Fatalln("Too many errors received. Quitting.") fails the whole location. No code on master changed since March, so this is data-driven: other countries do not hold that user.

Evidence from upstream daily update runs that picked united_states:

Run What the log shows
38896983332 3 non-JSON responses, then 6 identical RESOURCE_LIMITS_EXCEEDED on the same page
39063640920 1 missing data, 2 non-JSON, then 6 identical RESOURCE_LIMITS_EXCEEDED
39792877820 9 non-JSON responses in a row

Change (github/github.go only, plus tests)

  • A failing page is retried in place (same cursor) one user at a time, instead of restarting the search window.
  • When a single user still fails 3 times and a light query for them (login, followers) succeeds, that user is skipped and logged as Skipping <login>: …; the search continues after them. If the light query also fails, nothing is skipped (so rate limits or outages never drop users).
  • The retry limit counts consecutive errors. More than 10 skipped users still fails the run, so a broken search cannot publish an empty page.
  • Windows are paged by results consumed, and the cursor advances past every edge, so a page-size change cannot end a 1000-result window early.
  • Dropped totalPullRequestContributions: nothing reads it, and it is the field named in the RESOURCE_LIMITS_EXCEEDED errors.

Tests

github/github_test.go adds a fake search API (no network) that honours followers:<N, first/after and the 1000-result cap:

  • every user returned on a clean search;
  • a user whose data never loads is skipped (first, middle and last position), with everyone else kept;
  • a skip across the 1000-result cap keeps every later user;
  • errors scattered over a long search no longer add up to a failure, and nobody is skipped for them.

With the skip turned off, the skip tests fail with the production message Too many errors received. Quitting.. go fmt, go vet ./..., go build ./..., go test ./... pass; golint reports no new warnings.

United States verify run: pending

Per the contribution section, I will run my fork's daily update workflow on this change and link the gh-pages commit with the new United States numbers here. That run is pending: the fork's workflows are not enabled yet. I will update this PR when it lands.

Relation to #146 and #148

Both target this issue. #146 halves the page size on RESOURCE_LIMITS_EXCEEDED and resets the retry count, which cannot get past a user who fails at page size 1 or with a non-JSON timeout (most of the logs above). #148 skips such a user, like this PR, in a larger rewrite (github.go +262/−129). This PR is a smaller version of that skip (github.go +141/−91, plus tests). It will add a real United States run as evidence. Happy to close this in favour of #148 if you prefer that one.

🤖 Generated with Claude Code

Since 2026-08-24 one United States user's contributions have been too
costly for GitHub to return: the page holding them fails with
RESOURCE_LIMITS_EXCEEDED or a non-JSON timeout body. SearchUsers retried
the same page every time, so all ten retries hit the same user and
log.Fatalln failed the whole location.

Now a failing page is retried in place one user at a time. When a single
user still fails three times while a light query for them succeeds, that
user is skipped and logged, and the search goes on. The retry limit
counts consecutive errors only, and more than ten skips still fails the
run so a broken search cannot publish an empty page.

Also drop totalPullRequestContributions: nothing reads it, and it is the
field named in the RESOURCE_LIMITS_EXCEEDED errors.

Fixes ashkulz#145

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Large locations fail with RESOURCE_LIMITS_EXCEEDED and never refresh (e.g. united_states)

1 participant