sparkgeo / tile-id-api

MIT License
2 stars 0 forks source link

9 Intermittent missing quadkey value #10

Closed matthewscottgordon closed 1 month ago

matthewscottgordon commented 1 month ago

Closes #9

I was not able to duplicate this issue but I did find a race condition the definitely could have produced the observed issue.

allIdentifiers[:] does not copy the underlying array like [:] does in Python, it just creates a new slice that points the same underlying array as allIdentifiers. So identifiers.SortIdentifiers() was still sorting the elements in allIdentifiers despite the apparent attempt to make a copy.

This could definitely cause keys to go missing if requests are handled concurrently. You would have multiple handlers attempting to sort the same array at the same time.