Replies: 2 comments
|
The TLS handshake is covered by HTTPX’s connect timeout. HTTPX passes the same There are two nuances worth documenting:
So the short answer is: TLS yes; DNS usually within the async backend’s connect scope, but not universally guaranteed—especially for blocking system DNS in the sync client. A separate DNS timeout is not currently exposed by HTTPX; applications needing a strict overall deadline need an outer cancellation/deadline appropriate to their concurrency backend. |
|
The short answer is: TLS is included, while DNS has an important backend/platform caveat. HTTPX passes the DNS happens inside the backend’s TCP-connect operation. With the async AnyIO backend, the entire So I would document it approximately as: “The connect timeout applies to socket connection establishment and TLS handshakes. DNS resolution occurs as part of connection establishment, but whether a blocking resolver can be interrupted is backend/platform dependent.” A separate DNS timeout would require a distinct resolver/backend abstraction; it cannot be implemented reliably just by splitting the existing HTTPX timeout value. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Thanks for a more granular timeout system than requests!
I wish the documentation clarified a few details about the connect timeout: https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration
I can submit a documentation PR once these are clarified.
All reactions