Repository navigation
Keep one polling timer for each data file - #63
Merged
Merged
Conversation
The Programmatic update part of the Data update page starts an immediate check and no new schedule. Each way out of an update schedules the next check, so an update started by hand added a second chain of checks. The data file now keeps its pending timer and the next one replaces it.
This was referenced Nov 10, 2026
Merged
The test that counts the checks in one interval ended with the check's request still open. Its failure then scheduled the next check after the test, either on a later test's fake clock, which counted two timers on Ubuntu ARM, or on the real clock, which kept the test run from ending.
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.
Problem
Each update of a data file, whether the update service scheduled it or it was started by hand with
updateDataFile, ends incheckNextUpdate, which callsscheduleUpdate(onrcat 24592ac,failat line 350 and the end of a download at line 691 ofdataFileUpdateService.js).scheduleUpdate, lines 156 to 165, starts a newsetTimeoutevery time and keeps no handle to the one already waiting. So every update started by hand adds another polling schedule for the same data file, and the data file is then checked once for each of them in every polling interval.What the specification says
Data updates at 77dc1f62. A data file has one polling schedule, which an update pauses and resumes rather than adds to (lines 326 and 332):
A programmatic update is one immediate check, not a schedule of its own (lines 204 to 206 and 340 to 344):
What changed
scheduleUpdatekeeps the pending timer on the data file aspollingTimer, clears it before it starts the next one, and clears the field when the timer fires. So a data file has one polling timer however many updates are started. The timer still holds the update service and the data file weakly, as before, and still passestruefor an update the service started, whichrcadded in #69.b9d2928e merged
rcat 24592ac. Its one conflict was the call in the timer, whererchad added thetrueand this branch had added the line that clearspollingTimer. Both are kept. 40f20cf8 mergesrcat 7cbf8bc, which added #94's change to the same file in other lines, with no conflict.Tests
tests/pollingTimer.test.jsfakes the timers only, so the update's request really fails to connect, and checks four things. An update started by hand leaves one timer pending, several leave one, polling checks once in an interval after updates by hand, and polling carries on after a check the timer started.18c5bd7f makes "polling checks once in an interval" wait for the check its timer starts. Without that wait the test ended with the check's request still open, and the request's failure then scheduled the next check after the test, on a later test's fake clock or on the real one. The first full build of this draft (run 43479170078) failed on Ubuntu ARM in "polling carries on" with two timers where one was expected, and a separate run of the pipeline tests on x64 passed every test and then never ended, until its time limit.
rcat 7cbf8bc without the fix: run 43490122037, 3 of 1,147 failed, being "an update started by hand leaves one timer pending" (2 timers where 1 is expected), "several updates started by hand still leave one timer pending" and "polling checks once in an interval after updates by hand". The run then went on to its time limit and was cancelled, because the third test fails before it waits for its check.rcwithout this change too, because the committed types are older than the code (run 43485072238 found 23 type files thattscwrites differently onrcat 24592ac), so it is not a test of this change.Setting 'PullRequestSha'lines are 40f20cf, and each of the six Ubuntu, Ubuntu ARM and Windows jobs on Node 22 and 24 ran 1,360 unit tests passed with 2 skipped, and 132 integration tests passed with 4 skipped. macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.What remains
Nothing in this change.