josh icon indicating copy to clipboard operation
josh copied to clipboard

Fix race condition in check_auth

Open vlad-ivanov-name opened this issue 1 month ago • 1 comments

When a lot of requests arrive roughly at the same time, several requests can enter the critical section where an HTTP request to upstream is made to check the auth provided by the client. This means that potentially thousands of requests can get through to the remote, leading to rate limits and network errors with some remotes.

  • Fix the issue by extending the lock region
  • Switch mutex to async to avoid blocking runtime
  • Improve tracing

commit-id:d44447ef

vlad-ivanov-name avatar May 14 '24 13:05 vlad-ivanov-name