-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix raster tiles flicker & hang #2211
Conversation
6171a2f makes me think this might be the wrong solution. |
This looks like the right solution! I think this broke with 4f99e94 |
f97bbb6
to
4058e8d
Compare
90baedf
to
c33ad33
Compare
@ansis I amended this PR to fix both bugs. ? |
In what cases are tiles added to the cache while they are already in the cache? Is that a bug? |
It happened rarely during very fast zooms, probably due to a race condition. The LRU cache shouldn't get stuck in an infinite loop if the same key is added twice. We can debug the race condition separately. I want to get this out in a release ASAP. |
You're right. Reading the code, it is mysterious that this method could ever add the same tile twice. mapbox-gl-js/js/source/tile_pyramid.js Line 359 in e7b551c
|
I have a hunch that the duplicate tiles have the same root cause as #1834. Our re-use of tiles across the dateline isn't perfect. Because the LRU cache uses wrapped coords but the tile pyramid doesn't, we might add duplicate entries for a wrapped coord. |
Yeah, your hunch sounds right. I'll take a quick look to see if I can find something that regressed recently otherwise we can merge this to fix the fire and then properly fix it later. |
Did you mention that we were (unintentionally) not using the cache at all until a recent fix? |
We were using it, but only for the tiles at the current zoom. e6cb15c makes it look for parents too, which could have introduced this bug, or it could have just made it easier to hit. |
Could this be it?
Ideally c33ad33 isn't needed but it is a safe fix. Merging now, releasing and then properly fixing later sounds good! |
c33ad33
to
c377a5e
Compare
@ryanbaumann thanks for the video and jsfiddle. It looks like a different bug so I've opened a new issue: #2212 |
fixes #2208
fixes #2201
cc @jfirebaugh @ansis @mourner