Handling AsyncConnectionPool._attempt_to_acquire_connection returning false? #855
Unanswered
robo-corg
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was reading the code for
AsyncConnectionPool
to see if there were ways to tweak httpx so I can recover faster from network blips from another service I am calling. Looking at the_attempt_to_acquire_connection
implementation and I see it will bail out under various conditions but there doesn't seem to be anything that will retry getting a connection for a given status.It looks like the lock might protect some cases but its hard to understand if this is sufficient. If it is why have the waiting/ordering check?
From my reading of the code if multiple
_request
ever get queued up with no connection only one will get a connection and the rest will get PoolTimeouts.There seems like there is a similar issue with _max_connections being hit.
I can try to open a PR for this though I don't really have a good repro for any bug. I would the correct behavior here would be to trust the fairness of the
_pool_lock
if we can. It also seems like there needs to be some other async event that fires that retries_requests
where_attempt_to_acquire_connection
returned false though.Beta Was this translation helpful? Give feedback.
All reactions