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

Improve the cleanup functionality for thumbnails #12616

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

This is a pre-existing issue that I noticed while working on PR #12613, and fixing this also brings the thumbnail code inline with the page code.

Given the intermittent nature of all of this, it's somewhat difficult to reproduce it consistently; however the following steps should at least provide an outline:

  1. Open the sidebar, and the thumbnailView, and start scrolling around.
  2. Quickly close the sidebar, so that all thumbnails won't have time to finish rendering.
  3. Either wait for the cleanup-timeout to occur, or simply run PDFViewerApplication.cleanup() in the console.

What intermittently happens here is that WorkerTransport.startCleanup rejects, and consequently that cleanup doesn't complete as intended, since some of the thumbnails are left in a pending renderingState[1].
Fixing this is simple though, and only requires updating PDFThumbnailViewer.cleanup along the lines of BaseViewer.cleanup.


[1] Keep in mind that thumbnails will only render when the thumbnailView is visible, to reduce resource usage.

*This is a pre-existing issue that I noticed while working on PR 12613, and fixing this also brings the thumbnail code inline with the page code.*

Given the intermittent nature of all of this, it's somewhat difficult to reproduce it consistently; however the following steps should at least provide an outline:
 1. Open the sidebar, and the thumbnailView, and start scrolling around.
 2. *Quickly* close the sidebar, so that all thumbnails won't have time to finish rendering.
 3. Either wait for the cleanup-timeout to occur, or simply run `PDFViewerApplication.cleanup()` in the console.

What *intermittently* happens here is that `WorkerTransport.startCleanup` rejects, and consequently that cleanup doesn't complete as intended, since some of the thumbnails are left in a *pending* renderingState[1].
Fixing this is simple though, and only requires updating `PDFThumbnailViewer.cleanup` along the lines of `BaseViewer.cleanup`.

---
[1] Keep in mind that thumbnails will *only* render when the thumbnailView is visible, to reduce resource usage.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/96b3262248b831b/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/96b3262248b831b/output.txt

Total script time: 4.15 mins

Published

@timvandermeij timvandermeij merged commit 1f65896 into mozilla:master Nov 14, 2020
@timvandermeij
Copy link
Contributor

Thanks!

@Snuffleupagus Snuffleupagus deleted the PDFThumbnailViewer-cleanup branch November 14, 2020 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants