Skip to content

Commit

Permalink
[3.6] Fix issue #4190 (#4197). (#4235)
Browse files Browse the repository at this point in the history
(cherry picked from commit 564d9cc)

Co-authored-by: polcak <ipolcak@fit.vutbr.cz>
  • Loading branch information
asvetlov and polcak authored Oct 19, 2019
1 parent c43ae74 commit 78ea83f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
16 changes: 8 additions & 8 deletions docs/client_quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,10 @@ Timeouts

Timeout settings are stored in :class:`ClientTimeout` data structure.

By default *aiohttp* uses a *total* 5min timeout, it means that the
By default *aiohttp* uses a *total* 300 seconds (5min) timeout, it means that the
whole operation should finish in 5 minutes.

The value could be overridden by *timeout* parameter for the session::
The value could be overridden by *timeout* parameter for the session (specified in seconds)::

timeout = aiohttp.ClientTimeout(total=60)
async with aiohttp.ClientSession(timeout=timeout) as session:
Expand All @@ -420,24 +420,24 @@ Supported :class:`ClientTimeout` fields are:

``total``

The whole operation time including connection
The maximal number of seconds for the whole operation including connection
establishment, request sending and response reading.

``connect``

The time
consists connection establishment for a new connection or
waiting for a free connection from a pool if pool connection
The maximal number of seconds for
connection establishment of a new connection or
for waiting for a free connection from a pool if pool connection
limits are exceeded.

``sock_connect``

A timeout for connecting to a peer for a new connection, not
The maximal number of seconds for connecting to a peer for a new connection, not
given from a pool.

``sock_read``

The maximum allowed timeout for period between reading a new
The maximal number of seconds allowed for period between reading a new
data portion from a peer.

All fields are floats, ``None`` or ``0`` disables a particular timeout check, see the
Expand Down
13 changes: 8 additions & 5 deletions docs/client_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ The client session supports the context manager protocol for self closing.

Use ``timeout`` parameter instead.

:param timeout: a :class:`ClientTimeout` settings structure, 300 seconds (5min)
total timeout by default.

:param bool connector_owner:

Close connector instance on session closing.
Expand Down Expand Up @@ -352,7 +355,7 @@ The client session supports the context manager protocol for self closing.
:class:`float` is still supported for sake of backward
compatibility.

If :class:`float` is passed it is a *total* timeout.
If :class:`float` is passed it is a *total* timeout (in seconds).

:param ssl: SSL validation mode. ``None`` for default SSL check
(:func:`ssl.create_default_context` is used),
Expand Down Expand Up @@ -766,7 +769,7 @@ certification chaining.
does not have Content-Length header.
``True`` by default (optional).

:param timeout: a :class:`ClientTimeout` settings structure, 5min
:param timeout: a :class:`ClientTimeout` settings structure, 300 seconds (5min)
total timeout by default.

:param loop: :ref:`event loop<asyncio-event-loop>`
Expand Down Expand Up @@ -1559,7 +1562,7 @@ ClientTimeout

.. attribute:: connect

Total timeout for acquiring a connection from pool. The time
Maximal number of seconds for acquiring a connection from pool. The time
consists connection establishment for a new connection or
waiting for a free connection from a pool if pool connection
limits are exceeded.
Expand All @@ -1571,14 +1574,14 @@ ClientTimeout

.. attribute:: sock_connect

A timeout for connecting to a peer for a new connection, not
Maximal number of seconds for connecting to a peer for a new connection, not
given from a pool. See also :attr:`connect`.

:class:`float`, ``None`` by default.

.. attribute:: sock_read

A timeout for reading a portion of data from a peer.
Maximal number of seconds for reading a portion of data from a peer.

:class:`float`, ``None`` by default.

Expand Down

0 comments on commit 78ea83f

Please sign in to comment.