This repository was archived by the owner on Jul 15, 2024. It is now read-only.

Description
The client should re-authenticate itself if it needs to (receives a "unauthenticated" response).
This is a little tricky to do properly, one must consider the following invariants:
- there might be multiple requests running in parallel, ideally you only want to re-auth after the first failure and let the others wait for retry
- the
in_flight_semaphore locks reduce the maximum requests happening at the same time in most cases. We need to be careful to not cause a deadlock
Also the code itself could see some more love and refactoring to remove code duplication