Decide a non-positive pdf.js timeout synchronously instead of on a zero timer - #40
Merged
soumeh01 merged 2 commits intoSep 3, 2026
Conversation
…ro timer A zero timer still races the worker's reply: a warm thread answers a small document within one Windows scheduler tick, so the "timed out" rejection the pageStore test expects was missing on the windows-11-arm runner. A timeout of zero or less now rejects and terminates the worker right after the request is posted.
soumeh01
approved these changes
Sep 3, 2026
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.
The v2.3.9 release run failed on the windows-11-arm leg in the pageStore test "pdf.js extracts the fixture PDF page by page with nothing installed": the extraction with
timeoutMs: -1resolved instead of rejecting with "timed out".The extractor clamped a non-positive timeout to a zero timer and posted the request to the worker anyway. A zero timer is a 1 ms timer, and on Windows the event loop's poll wait has scheduler-tick granularity, so a warm worker thread answered the two-page fixture before the timer fired and the reply cleared the timeout. The same commit passed that runner on two scheduled main runs, so the failure was a race, not a regression.
A timeout of zero or less now rejects and terminates the worker synchronously right after the request is posted; a positive timeout still arms a timer. The existing test needs no change and now exercises a deterministic path. The tracked bundle is regenerated.
Verified with
npm run compile, eslint and the pageStore suite in the extension host.