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
// Exceeded the default RPC timeout without the Operation completing.
415
+
// Library is no longer polling for the Operation status. Consider
416
+
// increasing the timeout.
417
+
}
418
+
```
419
+
420
+
### LRO Timeouts
421
+
The polling operations have a default timeout that varies from service to service.
422
+
The library will throw a `java.util.concurrent.CancellationException` with the message:
423
+
`Task was cancelled.`if the timeout exceeds the operation. A `CancellationException`
424
+
does not mean that the backend GCP Operation was cancelled. This exception is thrown from the
425
+
client library when it has exceeded the total timeout without receiving a successful status from the operation.
426
+
Our client libraries respect the configured values setin the OperationTimedPollAlgorithm for each RPC.
427
+
428
+
Note: The client library handles the Operation's polling mechanism for you. By default, there is no need
429
+
to manually poll the status yourself.
400
430
431
+
### Default LRO Values
432
+
Each LRO RPC has a pre-configured default values. You can find these values by
433
+
searching in each Client's `StubSettings`'s class. The default LRO settings are initialized
434
+
inside the `initDefaults()` method in the nested Builder class.
435
+
436
+
For example, in google-cloud-aiplatform v3.24.0, the default [OperationTimedPollAlgorithm](https://github.com/googleapis/google-cloud-java/blob/9ae786d1acdc7354adf86b78691570668caa293d/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/EndpointServiceStubSettings.java#L755-L765)
437
+
has these default values:
438
+
```java
439
+
OperationTimedPollAlgorithm.create(
440
+
RetrySettings.newBuilder()
441
+
.setInitialRetryDelay(Duration.ofMillis(5000L))
442
+
.setRetryDelayMultiplier(1.5)
443
+
.setMaxRetryDelay(Duration.ofMillis(45000L))
444
+
.setInitialRpcTimeout(Duration.ZERO)
445
+
.setRpcTimeoutMultiplier(1.0)
446
+
.setMaxRpcTimeout(Duration.ZERO)
447
+
.setTotalTimeout(Duration.ofMillis(300000L))
448
+
.build())
449
+
```
450
+
Both retries and LROs share the same RetrySettings class. Note the corresponding link:
451
+
- Total Timeout (Max Time allowed for polling): 5 minutes
452
+
- Initial Retry Delay (Initial delay before first poll): 5 seconds
453
+
- Max Retry Delay (Maximum delay between each poll): 45 seconds
454
+
- Retry Delay Multiplier (Multiplier value to increase the poll delay): 1.5
455
+
456
+
The RPC Timeout values have no use in LROs and can be omitted or set to the default values
457
+
(`Duration.ZERO` for Timeouts or `1.0` for the multiplier).
458
+
459
+
### Configuring LRO Timeouts
460
+
To configure the LRO values, create an OperationTimedPollAlgorithm object and update the
0 commit comments