geotiler icon indicating copy to clipboard operation
geotiler copied to clipboard

Implement retries in fetch_tile

Open swartjean opened this issue 4 years ago • 1 comments

I have noticed an issue while using MapProxy as a local tile cache where the connection can be occasionally be dropped before the full request/response interaction has been completed.

This results in a series of errors like the ones below, and a set of error tiles being rendered onto the map.

Unable to download http://localhost:8080/tiles/layer/grid/11/1129/1228.png (error: Server disconnected)
Unable to download http://localhost:8080/tiles/layer/grid/11/1128/1227.png (error: Server disconnected)

Actually navigating to these tile endpoints works just fine, which shows that the tiles are generally being served correctly.

A quick hack shows that wrapping the body of fetch_tile in a simple retry loop is all that is needed to mitigate this and make the downloader a bit more robust.

I may take a look at implementing this myself if time allows, but I thought that I would bring it to your attention just in case it is something that you have already thought about.

swartjean avatar Feb 17 '21 15:02 swartjean

I wonder if this could be handled somehow with aiohttp library. I need to do a bit of research.

Would you know what could be exact reason for the disconnection?

wrobell avatar Feb 18 '21 19:02 wrobell