Skip to content
Myr

Merge pull request #6600 from MestreLion/MestreLion-connection-timeout-note

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Add note on connection timeout being larger than specified. Fix #5773

authored by Ian Stapleton Cordasco · committed by GitHub · parents 51d0d83, 92f9e43 · Browse files · 1 file+14 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−0 removed

  • other:+14 added−0 removed

1 file+14 added−0 removed

modified:docs/user/advanced.rst+14 added
1120 unmodified lines
1121::11221123 r = requests.get('https://github.com', timeout=None)11241125.. note:: The connect timeout applies to each connection attempt to an IP address.1126 If multiple addresses exist for a domain name, the underlying ``urllib3`` will1127 try each address sequentially until one successfully connects.1128 This may lead to an effective total connection timeout *multiple* times longer1129 than the specified time, e.g. an unresponsive server having both IPv4 and IPv61130 addresses will have its perceived timeout *doubled*, so take that into account1131 when setting the connection timeout.1132.. note:: Neither the connect nor read timeouts are `wall clock`_. This means1133 that if you start a request, and look at the time, and then look at1134 the time when the request finishes or times out, the real-world time1135 may be greater than what you specified.113611371138.. _`wall clock`: https://wiki.php.net/rfc/max_execution_wall_time1139.. _`connect()`: https://linux.die.net/man/2/connect