Fix race conditions in router inference when handling concurrent requests.
Fix race conditions in router inference when handling concurrent requests.