@@ -208,9 +208,15 @@ class XdsClient::XdsChannel::AdsCall final
208208 if (state.HasResource ()) return ;
209209 // Start timer.
210210 ads_call_ = std::move (ads_call);
211+ Duration timeout = ads_call_->xds_client ()->request_timeout_ ;
212+ if (timeout == Duration::Zero ()) {
213+ timeout =
214+ ads_call_->xds_channel ()->server_ .ResourceTimerIsTransientFailure ()
215+ ? Duration::Seconds (30 )
216+ : Duration::Seconds (15 );
217+ }
211218 timer_handle_ = ads_call_->xds_client ()->engine ()->RunAfter (
212- ads_call_->xds_client ()->request_timeout_ ,
213- [self = Ref (DEBUG_LOCATION, " timer" )]() {
219+ timeout, [self = Ref (DEBUG_LOCATION, " timer" )]() {
214220 ApplicationCallbackExecCtx callback_exec_ctx;
215221 ExecCtx exec_ctx;
216222 self->OnTimer ();
@@ -237,9 +243,15 @@ class XdsClient::XdsChannel::AdsCall final
237243 << " } from xds server" ;
238244 resource_seen_ = true ;
239245 state.SetDoesNotExist ();
246+ absl::Status status =
247+ ads_call_->xds_channel ()->server_
248+ .ResourceTimerIsTransientFailure ()
249+ ? absl::UnavailableError (absl::StrCat (
250+ " xDS server " , ads_call_->xds_channel ()->server_uri (),
251+ " not responding" ))
252+ : absl::NotFoundError (" does not exist" );
240253 ads_call_->xds_client ()->NotifyWatchersOnResourceChanged (
241- absl::NotFoundError (" does not exist" ), state.watchers (),
242- ReadDelayHandle::NoWait ());
254+ std::move (status), state.watchers (), ReadDelayHandle::NoWait ());
243255 }
244256 }
245257 ads_call_->xds_client ()->work_serializer_ .DrainQueue ();
0 commit comments