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
Set pyramid thumb versions to -1 (Fix #12538) #3713
Conversation
Thumbnails that are generated while pyramids are being created (i.e. the clock symbol) should have a version of -1 so that clients know to refresh. There is currently no case where `version == null` is used or even possible.
e2761e9
to
365b042
Compare
Currently, after the pyramid is generated the thumbnail versions are not nulled. |
I think this is working fine. But for some reason I am still having trouble with thumbnail caching in web.
However, upon reloading the dataset in web (without browser refresh) all the versions are "-1" but I mostly have "timer" thumbnails still. This means that at some point, with the version as "-1" the browser asked for a thumbnail and got a "timer" thumbnail, which got cached. |
I'm also struggling to know which version number to return for image.getThumbVersion(). I have been simply returning the highest version number for all the thumbnails for the image. But that fails with this PR since it will always return 0 instead of -1. So I have tried to return the version for the highest thumbnail.details.creationEvent.id but this fails because there are version 0 and version 1 for the same event id. Also, simply picking the version of the thumbnail with highest thumbnail ID seems to fail because the latest version may not be the most recently created thumbnail. E.g.
|
I'll spend some more time on this tomorrow, @will-moore, but there's likely some state in the |
Temporarily excluded to assess the cause of the pyramid generation hanging described in ome/bioformats#1725. |
The retrieveThumbnail method was internally resetting the cached metadata object when inProgress was true. Now, we temporarily copy this value so that following saves don't create new objects.
Hopefully 0ac0f53 should fix @will-moore's issue. |
Only one of the 2 tests is failing now (see 427). This is the less used method, so still some hope. |
@joshmoore This still isn't working for me on trout (haven't tried locally yet to dig any deeper). |
Or maybe (as I asked above) there are times when my
|
Can you may help me write a failing test? I'm running a bit blind at the moment. |
I don't know what the expected behaviour is yet, so don't know what to test. Below is my output from First lines are rows in the thumbnail table, printing out Immediately after import has completed I see one event, with 2 thumb versions (0 and -1):
Next, I see this (I assume pyramid generation is completed now):
At this point I load (and the browser caches) thumbnail?version=-1 but the thumbnail I am getting here still has the Clock. Then there is some other event with version -1 and I'm now getting:
All this time, I still have thumb?version=-1 with the Clock cached on the browser, but if I open the thumb in a new tab and request:
I see the new image thumbnail. Generating this thumbnail updates the thumb table
but my Then I open the Preview tab and save a change to the rendering settings and request a new thumbnail. Now we have this:
but I'm STILL getting So, there's basically 2 problems above:
|
Ok, trying the same thing again, with the rebuilt server. Immediately after import and start of pyramid creation
I see only a single event this time, with version -1. This is different from above where I saw versions 0 and -1.
Then, still during pyramid generation I see:
This is the same right after
I still see
Now, after I manually refresh thumb in browser (shows thumb image) I see
So, the problem from above is that the thumbnail table has version: -1 thumbnails before Pyramid generation is complete. |
Not sure the best way to write a test for this. |
Discussed this with @will-moore. This is exactly what I was expecting, and seems to match his local build behavior as described in #3713 (comment) There was one misunderstand: the cc: @jburel @dominikl -- in case something like this is useful. |
More frequent closing of the ThumbnailBean (as Web does) led to more predictable failure. The issue seems again to be that for some code paths (`getThumbnail`), multiple tbs are being produced.
Several private methods have now been given the rewriteMetadata arg which decides whether or not the instance variable `thumbnailMetadata` is over- written when a `*Direct` method is called. This is a suboptimal fix since it leads to more complexity but until this class is reworked, this seems to be the safest.
Fix for unpredictable failures pushed. |
The UI workflow from #3750 is going just fine and as expected, the bug is not there, the behaviour as expected. Looks good. |
Thanks @pwalczysko. Merging this backend PR. #3750 will need one last round of quick retesting after @will-moore's last commit. |
Set pyramid thumb versions to -1 (Fix #12538)
This PR introduced
why is expecting 0? |
Thumbnails that are generated while pyramids are being
created (i.e. the clock symbol) should have a version of
-1 so that clients know to refresh.
There is currently no case where
version == null
isused or even possible.
cc: @will-moore