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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
add loop for re-trying failed tiles [Take 3] #2238
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you for taking this on! The cleanup looks good. I think maybe that's all that's necessary... What do you think? Have you had a chance to play with it in action?
@Ughuuu Any word on finishing this up? |
Sorry for the delay. Will try it soon and let you know of my findings. I wanted to use this as was using Cloudflare to store images and it would error rather a lot, then changed CDN to bunny and now it doesnt error a lot. As that worked now didn't give it that much importance, but now came back to this to test it properly. |
Tried it now locally and it doesn't quite work. Added logging and the issue is that |
With that fix tried it locally and it works. Set tileRetryDelay to 3 and used a tileset where all tiles were missing from my computer and returning 404(and started a webserver locally). |
Ready to be merged from my side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you for testing it, cleaning it up, and documenting it. I'm glad to have this in!
* master: (276 commits) Changelog for #2280 and #2238 remove trailing space fix problem with click precision on ReferenceStrip Changelog for #2273 Also add documentation for tileRetryDelay try fix with check for null and undefined fix build error Add tileRetryMax documentation. Revert async support and event breaking support in EventSource. Changelog for #2276 add box-sizing property to the navigator display region Implement support for async function and promise type recognition with $.type. Add $.Promise proxy. Implement support for promises in EventSource. Implement ability to abort events as well as prioritize events. Changelog for #2270 issues/2192 fix. Starting 4.0.1 Version 4.0.0 JSDoc fixes Changelog for #2256 Changelog for #2249 removed polling vs resizeviewer option from demo ...
Hi, I'm very interested in this change and am excited to see retry-functionality coming to OpenSeadragon. In the screenshot you can see tile 2-1-0.jpg getting a 404 (via 302 redirect) on the first attempt, but then loading successfully on retries 1 - 5. |
Just a note, this could be implemented outside the ImageJob class by re-defining the download procedure in TileSource class, without changing OSD. Just fyi, not sure if it would be a good design decision. |
@Aiosa Good point. Now that this has been implemented this way, though, I figure we might as well run with it for now. |
Actually the ImageJob has a timeout so that would get in the way... unless you want to have shared time span for all the tries (which could be a good idea since 30 secs that are available I think should be enough). Just wondering what does this patch mean wrt. timeous now, retry count 3 means potential timeout 90secons? |
Yes, I believe that's what it means. I think that makes sense; I would think it would be odd to have retries and then force them all into the same timeout. Also, the way it's implemented, it doesn't try again immediately, but waits until all of the other tiles have been loaded (at least I think so). |
Based on #1627
From @paaddyy who originally wrote it:
I faced some issues with OpenSeadragon in my current project when tiles failed loading when the server is too busy. I missed a functionality to reload the failed tiles and after some research I only found an answer that it isn't possible yet to reload specific tiles.
So I extended the ImageLoader and ImageJob class a bit. If the ImageLoader notices within completeJob that a request failed and the job didn't run more than 3 times, it will re-run the job after a timeout of 2500ms. After 3 times failing it will be handled the normal way.
Do you think it's a good solution?
I also know the "tile-load-failed"-event and the xhr object within the event but i wasn't able to write a suitable solution with that object 馃槃