aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/client_channel.cc
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-07-30 22:06:46 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-07-30 22:06:46 -0700
commitd030114058b167ba3cbe71796ae30b99bc0c2e22 (patch)
treef84edd4ed14e69569712b2bf261e606c7af41bf9 /src/core/ext/filters/client_channel/client_channel.cc
parent844d4efcd2325504c6d916f7ad3b3cc638fada70 (diff)
Add back in disable retries
Diffstat (limited to 'src/core/ext/filters/client_channel/client_channel.cc')
-rw-r--r--src/core/ext/filters/client_channel/client_channel.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc
index 0368590a6a..888a5efda3 100644
--- a/src/core/ext/filters/client_channel/client_channel.cc
+++ b/src/core/ext/filters/client_channel/client_channel.cc
@@ -1154,6 +1154,16 @@ static void pending_batches_add(grpc_call_element* elem,
grpc_connected_subchannel_call_get_parent_data(
calld->subchannel_call));
retry_commit(elem, retry_state);
+ // If we are not going to retry and have not yet started, pretend
+ // retries are disabled so that we don't bother with retry overhead.
+ if (calld->num_attempts_completed == 0) {
+ if (grpc_client_channel_trace.enabled()) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: disabling retries before first attempt",
+ chand, calld);
+ }
+ calld->enable_retries = false;
+ }
}
}
}
@@ -2793,6 +2803,12 @@ static void apply_service_config_to_call_locked(grpc_call_element* elem) {
}
}
}
+ // If no retry policy, disable retries.
+ // TODO(roth): Remove this when adding support for transparent retries.
+ if (calld->method_params == nullptr ||
+ calld->method_params->retry_policy() == nullptr) {
+ calld->enable_retries = false;
+ }
}
// Invoked once resolver results are available.