@@ -208,11 +208,11 @@ public static class Builder extends StubSettings.Builder<IamCredentialsStubSetti
208208 ImmutableMap .Builder <String , ImmutableSet <StatusCode .Code >> definitions =
209209 ImmutableMap .builder ();
210210 definitions .put (
211- "idempotent " ,
211+ "retry_policy_1_codes " ,
212212 ImmutableSet .copyOf (
213213 Lists .<StatusCode .Code >newArrayList (
214- StatusCode .Code .DEADLINE_EXCEEDED , StatusCode .Code .UNAVAILABLE )));
215- definitions .put ("non_idempotent " , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
214+ StatusCode .Code .UNAVAILABLE , StatusCode .Code .DEADLINE_EXCEEDED )));
215+ definitions .put ("no_retry_codes " , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
216216 RETRYABLE_CODE_DEFINITIONS = definitions .build ();
217217 }
218218
@@ -226,12 +226,14 @@ public static class Builder extends StubSettings.Builder<IamCredentialsStubSetti
226226 .setInitialRetryDelay (Duration .ofMillis (100L ))
227227 .setRetryDelayMultiplier (1.3 )
228228 .setMaxRetryDelay (Duration .ofMillis (60000L ))
229- .setInitialRpcTimeout (Duration .ofMillis (20000L ))
229+ .setInitialRpcTimeout (Duration .ofMillis (60000L ))
230230 .setRpcTimeoutMultiplier (1.0 )
231- .setMaxRpcTimeout (Duration .ofMillis (20000L ))
232- .setTotalTimeout (Duration .ofMillis (600000L ))
231+ .setMaxRpcTimeout (Duration .ofMillis (60000L ))
232+ .setTotalTimeout (Duration .ofMillis (60000L ))
233233 .build ();
234- definitions .put ("default" , settings );
234+ definitions .put ("retry_policy_1_params" , settings );
235+ settings = RetrySettings .newBuilder ().setRpcTimeoutMultiplier (1.0 ).build ();
236+ definitions .put ("no_retry_params" , settings );
235237 RETRY_PARAM_DEFINITIONS = definitions .build ();
236238 }
237239
@@ -273,23 +275,23 @@ private static Builder initDefaults(Builder builder) {
273275
274276 builder
275277 .generateAccessTokenSettings ()
276- .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("idempotent " ))
277- .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("default " ));
278+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("retry_policy_1_codes " ))
279+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("retry_policy_1_params " ));
278280
279281 builder
280282 .generateIdTokenSettings ()
281- .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("idempotent " ))
282- .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("default " ));
283+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("retry_policy_1_codes " ))
284+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("retry_policy_1_params " ));
283285
284286 builder
285287 .signBlobSettings ()
286- .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("idempotent " ))
287- .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("default " ));
288+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("retry_policy_1_codes " ))
289+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("retry_policy_1_params " ));
288290
289291 builder
290292 .signJwtSettings ()
291- .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("idempotent " ))
292- .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("default " ));
293+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("retry_policy_1_codes " ))
294+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("retry_policy_1_params " ));
293295
294296 return builder ;
295297 }
0 commit comments