Repository navigation
wikidata_stats: wait up to 10 minutes for Wikidata's lag, not 5 tries - #115
Merged
Merged
Conversation
After the import of #114, wikidata-stats failed twice with "Wikidata is lagging, giving up": the query service's lag hovered around the maxlag of 5 s, and 5 attempts of Retry-After (5 s) gave up within half a minute. Wait out maxlag for up to MAXLAG_WAIT (600 s) per call instead, and say how long it waited and what lagged when it does give up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P46G3NWFFqPMVwDmVo4vLJ
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.
After the import of #114,
wikidata-statsfailed twice (run 37618698260, attempts 1 and 2) withRuntimeError: Wikidata is lagging, giving up. The second attempt waited until the lag had dropped below 4 s, then still failed on its first read. The query service's lag hovers around themaxlagof 5 s (Waiting for wdqs1014: 6.75 seconds lagged.), and 5 attempts ×Retry-After: 5gave up within half a minute.Change
wikidata()waits outmaxlagfor up toMAXLAG_WAIT(600 s) per call instead of 5 attempts, as Wikimedia asks of bots. When it does give up, the error says how long it waited and what lagged.maxlag, which the sync waits out, and one where Wikidata never stops lagging, where it gives up after exactlyMAXLAG_WAIT.time.sleepis monkeypatched, so the tests take no time.make checkpasses andmake testgives 162 passed.After merging
The push runs
deploy-codebut notwikidata-stats, since the dump is unchanged. Use "Run workflow" on CI to copy the new counts (604,417 terms, 88 dictionaries) to Q133800945.🤖 Generated with Claude Code
https://claude.ai/code/session_01P46G3NWFFqPMVwDmVo4vLJ
Generated by Claude Code