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.
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 asallIdentifiers
. Soidentifiers.SortIdentifiers()
was still sorting the elements inallIdentifiers
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.