geotiler
geotiler copied to clipboard
Implement retries in fetch_tile
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.
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?