Skip to content

Decide a non-positive pdf.js timeout synchronously instead of on a zero timer - #40

Merged
soumeh01 merged 2 commits into
Open-CMSIS-Pack:mainfrom
MatthiasHertelArm:fix/pdfjs-timeout-race
Sep 3, 2026
Merged

Decide a non-positive pdf.js timeout synchronously instead of on a zero timer#40
soumeh01 merged 2 commits into
Open-CMSIS-Pack:mainfrom
MatthiasHertelArm:fix/pdfjs-timeout-race

Conversation

@MatthiasHertelArm

Copy link
Copy Markdown
Collaborator

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: -1 resolved 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.

MatthiasHertel80 and others added 2 commits September 3, 2026 14:08
…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
soumeh01 merged commit 78410a2 into Open-CMSIS-Pack:main Sep 3, 2026
8 checks passed
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.

3 participants