You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
I did some stress testing of OTP master branch and found out that if I rapidly fire different requests (1 per 0.5 seconds, around 20), some of them that normally return a 200 will suddenly start returning 500’s.
The performed requests were all send with similar parameters with only varying fromPlaces:
I've also seen this. It seems that the current usage of having runState as a field in GenericAStar is not thread-safe. I solved this by having a new GenericAStar per request and haven't had issues since.
Thanks @clinct for the report, and thank you @hannesj for pointing out the source of the problem. These state variables were originally function-scoped, but were pulled out to fields recently to make it possible to pause the routing process and observe its behavior. It's not immediately obvious to someone jumping into OTP that GenericAStar is not instantiated on a per-request basis, so yes we ended up with a non-thread-safe situation. OTP behavior is currently undefined under concurrent requests, so we'll make it a priority to fix this.
@abyrd I've always tried to report them when they come up, but this one slipped my mind, as I was working on a separate path service implementation at that time. (even tough it is actually a workaround for another bug in OTP)