venkivenkat / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

"Expired" tiles from modular tile providers are not being handled properly. #366

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We allow for the concept of "Expired" tiles. For example, the filesystem 
provider will return an "expired" tile if the tile in the file cache is older 
than a certain number of days. Osmdroid is supposed to then take that tile and 
present it to the user, but the tile request is supposed to stay alive and 
proceed through the tile provider chain. Currently the filesystem provider 
appears to be the only modular tile provider that uses this (the rescaleCache() 
also uses it but it is outside the tile provider chain).

The problem is that when MapTileModuleProviderBase.tileLoadedExpired() is 
called, the tile request is never removed from the mWorking queue because there 
is no removeTileFromQueues() call. This means that the filesystem provider will 
forever be "working" on that tile. Subsequent requests through the tile 
provider chain will always fall into a black hole.

The solution is simple - add a call to removeTileFromQueues() - however, while 
we are at it let's add a method 
IMapTileProviderCallback.mapTileRequestExpiredTile to make it much much clearer 
what is going on at the MapTileProviderBase rather than calling a 
mapTileRequestCompleted() followed by a mapTileRequestFailed() which is a 
sketchy solution.

Original issue reported on code.google.com by kurtzm...@gmail.com on 24 Aug 2012 at 5:27

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by kurtzm...@gmail.com on 24 Aug 2012 at 5:43

Attachments:

GoogleCodeExporter commented 9 years ago
Adding new patch with one additional fix:

We don't want to push scaled tiles (from rescaleCache()) into the tile cache if 
there is a non-expired tile already in the cache.

Original comment by kurtzm...@gmail.com on 24 Aug 2012 at 6:06

GoogleCodeExporter commented 9 years ago

Original comment by kurtzm...@gmail.com on 24 Aug 2012 at 6:07

Attachments:

GoogleCodeExporter commented 9 years ago
This patch has been working great for us and has fixed any stuck tile issues we 
were having. I am going to commit this patch and close this issue.

Original comment by kurtzm...@gmail.com on 30 Aug 2012 at 8:23

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1112.

Original comment by kurtzm...@gmail.com on 30 Aug 2012 at 8:24