You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
Clarify timeout definition and usage, especially on read timeout
- read timeout is the number of seconds the client will wait for the server to send a response.
In most cases, this is the maximum wait time before the server sends the first byte.
- connect timeout is the number of seconds to establish a connection to the server
Fixes internal b/238779055
Copy file name to clipboardExpand all lines: docs/storage/retry_timeout.rst
+15-10Lines changed: 15 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,22 +12,27 @@ Configuring Timeouts
12
12
--------------------
13
13
14
14
For a number of reasons, methods which invoke API methods may take
15
-
longer than expected or desired. By default, such methods all time out
16
-
after a default interval, 60.0 seconds. Rather than blocking your application
17
-
code for that interval, you may choose to configure explicit timeouts
18
-
in your code, using one of three forms:
15
+
longer than expected or desired. By default, such methods are applied a
16
+
default timeout of 60.0 seconds.
19
17
20
-
- You can pass a single integer or float which functions as the timeout for the
21
-
entire request. E.g.:
18
+
The python-storage client uses the timeout mechanics of the underlying
19
+
``requests`` HTTP library. The connect timeout is the number of seconds
20
+
to establish a connection to the server. The read timeout is the number
21
+
of seconds the client will wait for the server to send a response.
22
+
In most cases, this is the maximum wait time before the server sends
23
+
the first byte. Please refer to the `requests documentation <https://requests.readthedocs.io/en/latest/user/advanced/#timeouts>`_ for details.
24
+
25
+
You may also choose to configure explicit timeouts in your code, using one of three forms:
26
+
27
+
- You can specify a single value for the timeout. The timeout value will be
28
+
applied to both the connect and the read timeouts. E.g.:
22
29
23
30
.. code-block:: python
24
31
25
32
bucket = client.get_bucket(BUCKET_NAME, timeout=300.0) # five minutes
26
33
27
-
- You can also be passed as a two-tuple, ``(connect_timeout, read_timeout)``,
28
-
where the ``connect_timeout`` sets the maximum time required to establish
29
-
the connection to the server, and the ``read_timeout`` sets the maximum
30
-
time to wait for a completed response. E.g.:
34
+
- You can also pass a two-tuple, ``(connect_timeout, read_timeout)``,
35
+
if you would like to set the values separately. E.g.:
0 commit comments