@@ -147,75 +147,6 @@ class StreamingRetry(_BaseRetry):
147
147
Although the default behavior is to retry transient API errors, a
148
148
different predicate can be provided to retry other exceptions.
149
149
150
- There are two important concepts that retry/polling behavior may operate on,
151
- Deadline and Timeout, which need to be properly defined for the correct
152
- usage of this class and the rest of the library.
153
-
154
- Deadline: a fixed point in time by which a certain operation must
155
- terminate. For example, if a certain operation has a deadline
156
- "2022-10-18T23:30:52.123Z" it must terminate (successfully or with an
157
- error) by that time, regardless of when it was started or whether it
158
- was started at all.
159
-
160
- Timeout: the maximum duration of time after which a certain operation
161
- must terminate (successfully or with an error). The countdown begins right
162
- after an operation was started. For example, if an operation was started at
163
- 09:24:00 with timeout of 75 seconds, it must terminate no later than
164
- 09:25:15.
165
-
166
- Unfortunately, in the past this class (and the api-core library as a whole) has not
167
- been properly distinguishing the concepts of "timeout" and "deadline", and the
168
- ``deadline`` parameter has meant ``timeout``. That is why
169
- ``deadline`` has been deprecated and ``timeout`` should be used instead. If the
170
- ``deadline`` parameter is set, it will override the ``timeout`` parameter.
171
- In other words, ``retry.deadline`` should be treated as just a deprecated alias for
172
- ``retry.timeout``.
173
-
174
- Said another way, it is safe to assume that this class and the rest of this
175
- library operate in terms of timeouts (not deadlines) unless explicitly
176
- noted the usage of deadline semantics.
177
-
178
- It is also important to
179
- understand the three most common applications of the Timeout concept in the
180
- context of this library.
181
-
182
- Usually the generic Timeout term may stand for one of the following actual
183
- timeouts: RPC Timeout, Retry Timeout, or Polling Timeout.
184
-
185
- RPC Timeout: a value supplied by the client to the server so
186
- that the server side knows the maximum amount of time it is expected to
187
- spend handling that specific RPC. For example, in the case of gRPC transport,
188
- RPC Timeout is represented by setting "grpc-timeout" header in the HTTP2
189
- request. The `timeout` property of this class normally never represents the
190
- RPC Timeout as it is handled separately by the ``google.api_core.timeout``
191
- module of this library.
192
-
193
- Retry Timeout: this is the most common meaning of the ``timeout`` property
194
- of this class, and defines how long a certain RPC may be retried in case
195
- the server returns an error.
196
-
197
- Polling Timeout: defines how long the
198
- client side is allowed to call the polling RPC repeatedly to check a status of a
199
- long-running operation. Each polling RPC is
200
- expected to succeed (its errors are supposed to be handled by the retry
201
- logic). The decision as to whether a new polling attempt needs to be made is based
202
- not on the RPC status code but on the status of the returned
203
- status of an operation. In other words: we will poll a long-running operation until
204
- the operation is done or the polling timeout expires. Each poll will inform us of
205
- the status of the operation. The poll consists of an RPC to the server that may
206
- itself be retried as per the poll-specific retry settings in case of errors. The
207
- operation-level retry settings do NOT apply to polling-RPC retries.
208
-
209
- With the actual timeout types being defined above, the client libraries
210
- often refer to just Timeout without clarifying which type specifically
211
- that is. In that case the actual timeout type (sometimes also referred to as
212
- Logical Timeout) can be determined from the context. If it is a unary rpc
213
- call (i.e. a regular one) Timeout usually stands for the RPC Timeout (if
214
- provided directly as a standalone value) or Retry Timeout (if provided as
215
- ``retry.timeout`` property of the unary RPC's retry config). For
216
- ``Operation`` or ``PollingFuture`` in general Timeout stands for
217
- Polling Timeout.
218
-
219
150
Important Note: when a stream encounters a retryable error, it will
220
151
silently construct a fresh iterator instance in the background
221
152
and continue yielding (likely duplicate) values as if no error occurred.
0 commit comments