Skip to content
Discussion options

You must be logged in to vote

A request hook runs too early to guarantee a fresh signing timestamp at high concurrency.

In both the synchronous and asynchronous client paths, HTTPX invokes the request hooks in _send_handling_redirects() and only afterwards calls _send_single_request(). _send_single_request() then enters the transport, and the default transport/httpcore layer is where connection-pool acquisition happens. A request can therefore sit waiting for an available pooled connection after your hook has signed it. The hook also runs once per redirect request, but that does not move it past pool acquisition.

A custom Auth flow has the same fundamental timing issue: it prepares/yields the request before the transp…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by austind
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants