Clean up retry code (#25858)

pull/25925/head
Mark D. Roth 4 years ago committed by GitHub
parent 3de737cf8f
commit 46f48b8ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      src/core/ext/filters/client_channel/client_channel.cc
  2. 5
      src/core/ext/filters/client_channel/client_channel.h
  3. 2721
      src/core/ext/filters/client_channel/retry_filter.cc

@ -344,7 +344,7 @@ class DynamicTerminationFilter::CallData {
calld->call_context_, calld->path_,
calld->call_start_time_, calld->deadline_,
calld->arena_, calld->call_combiner_};
calld->lb_call_ = client_channel->CreateLoadBalancedCall(args, pollent, 0);
calld->lb_call_ = client_channel->CreateLoadBalancedCall(args, pollent);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p dynamic_termination_calld=%p: create lb_call=%p", chand,
@ -1133,16 +1133,8 @@ ClientChannel::~ClientChannel() {
RefCountedPtr<ClientChannel::LoadBalancedCall>
ClientChannel::CreateLoadBalancedCall(const grpc_call_element_args& args,
grpc_polling_entity* pollent,
size_t parent_data_size) {
const size_t alloc_size =
parent_data_size > 0
? (GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(LoadBalancedCall)) +
parent_data_size)
: sizeof(LoadBalancedCall);
auto* lb_call = static_cast<LoadBalancedCall*>(args.arena->Alloc(alloc_size));
new (lb_call) LoadBalancedCall(this, args, pollent);
return lb_call;
grpc_polling_entity* pollent) {
return args.arena->New<LoadBalancedCall>(this, args, pollent);
}
namespace {
@ -1974,7 +1966,8 @@ void ClientChannel::CallData::SetPollent(grpc_call_element* elem,
size_t ClientChannel::CallData::GetBatchIndex(
grpc_transport_stream_op_batch* batch) {
// Note: It is important the send_initial_metadata be the first entry
// here, since the code in pick_subchannel_locked() assumes it will be.
// here, since the code in ApplyServiceConfigToCallLocked() and
// CheckResolutionLocked() assumes it will be.
if (batch->send_initial_metadata) return 0;
if (batch->send_message) return 1;
if (batch->send_trailing_metadata) return 2;
@ -2515,15 +2508,10 @@ ClientChannel::LoadBalancedCall::~LoadBalancedCall() {
}
}
void* ClientChannel::LoadBalancedCall::GetParentData() {
return reinterpret_cast<char*>(this) +
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(LoadBalancedCall));
}
size_t ClientChannel::LoadBalancedCall::GetBatchIndex(
grpc_transport_stream_op_batch* batch) {
// Note: It is important the send_initial_metadata be the first entry
// here, since the code in pick_subchannel_locked() assumes it will be.
// here, since the code in PickSubchannelLocked() assumes it will be.
if (batch->send_initial_metadata) return 0;
if (batch->send_message) return 1;
if (batch->send_trailing_metadata) return 2;

@ -133,8 +133,7 @@ class ClientChannel {
AsyncConnectivityStateWatcherInterface* watcher);
RefCountedPtr<LoadBalancedCall> CreateLoadBalancedCall(
const grpc_call_element_args& args, grpc_polling_entity* pollent,
size_t parent_data_size);
const grpc_call_element_args& args, grpc_polling_entity* pollent);
private:
class CallData;
@ -361,8 +360,6 @@ class ClientChannel::LoadBalancedCall
grpc_polling_entity* pollent);
~LoadBalancedCall() override;
void* GetParentData();
void StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch);
// Invoked by channel for queued LB picks when the picker is updated.

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save