From 5965e176ca10ad8f090030dd70f81b8b7519ac46 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 2 Aug 2021 10:10:24 -0700 Subject: [PATCH] short-circuit retry code when retries not configured (#26840) --- src/core/ext/filters/client_channel/retry_filter.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/ext/filters/client_channel/retry_filter.cc b/src/core/ext/filters/client_channel/retry_filter.cc index b62ed29f35e..d6a28e5ad81 100644 --- a/src/core/ext/filters/client_channel/retry_filter.cc +++ b/src/core/ext/filters/client_channel/retry_filter.cc @@ -2189,6 +2189,11 @@ void RetryFilter::CallData::StartTransportStreamOpBatch( } // If we do not yet have a call attempt, create one. if (call_attempt_ == nullptr) { + // If there is no retry policy, then commit retries immediately. + // This ensures that the code below will always jump to the fast path. + // TODO(roth): Remove this special case when we implement + // transparent retries. + if (retry_policy_ == nullptr) retry_committed_ = true; // If this is the first batch and retries are already committed // (e.g., if this batch put the call above the buffer size limit), then // immediately create an LB call and delegate the batch to it. This