Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that the Cmd/Name/Ref caches are cleared when terminating the worker (PR 10863 follow-up) #10873

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented May 30, 2019

Usually when the worker is terminated it will also be completely destroyed/removed, which means that any global caches (such as the ones in src/core/primitive.js) should be automatically cleared in the process.

However, for certain ways of loading the pdf.worker.js file, e.g. passing in a re-usable worker to getDocument, using the workerPort functionality, or even disabling workers completely (even though this is never a good idea), the worker file may be kept in memory and these caches will not be cleared as expected.

@Snuffleupagus Snuffleupagus force-pushed the worker-terminate-clearPrimitiveCaches branch from 50caed6 to cc163a0 Compare May 30, 2019 16:55
…g the worker (PR 10863 follow-up)

Usually when the worker is terminated it will also be completely destroyed/removed, which means that any global caches (such as the ones in `src/core/primitive.js`) should be automatically cleared in the process.

However, for certain ways of loading the `pdf.worker.js` file, e.g. passing in a re-usable worker to `getDocument`, using the `workerPort` functionality, or even disabling workers completely  (even though this is never a good idea), the worker file may be kept in memory and these caches will not be cleared as expected.
@Snuffleupagus Snuffleupagus force-pushed the worker-terminate-clearPrimitiveCaches branch from cc163a0 to a3742a9 Compare May 30, 2019 18:57
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/5d617e6c5acda0d/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/86d689b280b19be/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/5d617e6c5acda0d/output.txt

Total script time: 17.84 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/86d689b280b19be/output.txt

Total script time: 25.70 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@timvandermeij timvandermeij merged commit 209e420 into mozilla:master May 31, 2019
@timvandermeij
Copy link
Contributor

Nice find!

@Snuffleupagus Snuffleupagus deleted the worker-terminate-clearPrimitiveCaches branch May 31, 2019 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants