This repository was archived by the owner on Nov 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,8 +211,32 @@ export class CallSettings {
211211 let longrunning = this . longrunning ;
212212 let apiName = this . apiName ;
213213 let retryRequestOptions = this . retryRequestOptions ;
214+ // If a method-specific timeout is set in the service config, and the retry codes for that
215+ // method are non-null, then that timeout value will be used to
216+ // override backoff settings.
217+ if (
218+ retry !== undefined &&
219+ retry !== null &&
220+ retry . retryCodes !== null &&
221+ retry . retryCodes . length > 0
222+ ) {
223+ retry . backoffSettings . initialRpcTimeoutMillis = timeout ;
224+ retry . backoffSettings . maxRpcTimeoutMillis = timeout ;
225+ retry . backoffSettings . totalTimeoutMillis = timeout ;
226+ }
227+ // If the user provides a timeout to the method, that timeout value will be used
228+ // to override the backoff settings.
214229 if ( 'timeout' in options ) {
215230 timeout = options . timeout ! ;
231+ if (
232+ retry !== undefined &&
233+ retry !== null &&
234+ retry . retryCodes . length > 0
235+ ) {
236+ retry . backoffSettings . initialRpcTimeoutMillis = timeout ;
237+ retry . backoffSettings . maxRpcTimeoutMillis = timeout ;
238+ retry . backoffSettings . totalTimeoutMillis = timeout ;
239+ }
216240 }
217241 if ( 'retry' in options ) {
218242 retry = mergeRetryOptions ( retry || ( { } as RetryOptions ) , options . retry ! ) ;
You can’t perform that action at this time.
0 commit comments