reviewable/pr13109/r13
Noah Eisen 7 years ago
parent 882dfeddd5
commit 467e8369a8
  1. 8
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  2. 3
      src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
  3. 3
      src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc
  4. 33
      src/core/ext/transport/inproc/inproc_transport.cc
  5. 3
      src/core/lib/iomgr/tcp_posix.cc
  6. 4
      src/core/lib/surface/call.cc

@ -1178,8 +1178,8 @@ static int glb_pick_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
bool pick_done = false;
if (glb_policy->rr_policy != nullptr) {
const grpc_connectivity_state rr_connectivity_state =
grpc_lb_policy_check_connectivity_locked(exec_ctx,
glb_policy->rr_policy, nullptr);
grpc_lb_policy_check_connectivity_locked(
exec_ctx, glb_policy->rr_policy, nullptr);
// The glb_policy->rr_policy may have transitioned to SHUTDOWN but the
// callback registered to capture this event
// (glb_rr_connectivity_changed_locked) may not have been invoked yet. We
@ -1525,8 +1525,8 @@ static void query_for_backends_locked(grpc_exec_ctx* exec_ctx,
op->flags = 0;
op->reserved = nullptr;
op++;
call_error = grpc_call_start_batch_and_execute(exec_ctx, glb_policy->lb_call,
ops, (size_t)(op - ops), nullptr);
call_error = grpc_call_start_batch_and_execute(
exec_ctx, glb_policy->lb_call, ops, (size_t)(op - ops), nullptr);
GPR_ASSERT(GRPC_CALL_OK == call_error);
op = ops;

@ -154,7 +154,8 @@ static void pf_cancel_picks_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
static void start_picking_locked(grpc_exec_ctx* exec_ctx,
pick_first_lb_policy* p) {
p->started_picking = true;
if (p->subchannel_list != nullptr && p->subchannel_list->num_subchannels > 0) {
if (p->subchannel_list != nullptr &&
p->subchannel_list->num_subchannels > 0) {
p->subchannel_list->checking_subchannel = 0;
grpc_lb_subchannel_list_ref_for_connectivity_watch(
p->subchannel_list, "connectivity_watch+start_picking");

@ -240,7 +240,8 @@ static void subchannel_data_cancel_connectivity_watch(
(size_t)(sd - sd->subchannel_list->subchannels),
sd->subchannel_list->num_subchannels, sd->subchannel, reason);
}
grpc_subchannel_notify_on_state_change(exec_ctx, sd->subchannel, nullptr, nullptr,
grpc_subchannel_notify_on_state_change(exec_ctx, sd->subchannel, nullptr,
nullptr,
&sd->connectivity_changed_closure);
}

@ -410,10 +410,11 @@ static void fail_helper_locked(grpc_exec_ctx* exec_ctx, inproc_stream* s,
grpc_metadata_batch_init(&fake_md);
inproc_stream* other = s->other_side;
grpc_metadata_batch* dest = (other == nullptr) ? &s->write_buffer_trailing_md
: &other->to_read_trailing_md;
grpc_metadata_batch* dest = (other == nullptr)
? &s->write_buffer_trailing_md
: &other->to_read_trailing_md;
bool* destfilled = (other == nullptr) ? &s->write_buffer_trailing_md_filled
: &other->to_read_trailing_md_filled;
: &other->to_read_trailing_md_filled;
fill_in_metadata(exec_ctx, s, &fake_md, 0, dest, nullptr, destfilled);
grpc_metadata_batch_destroy(exec_ctx, &fake_md);
@ -612,10 +613,11 @@ static void op_state_machine(grpc_exec_ctx* exec_ctx, void* arg,
(!s->send_message_op ||
(s->t->is_client &&
(s->trailing_md_recvd || s->to_read_trailing_md_filled)))) {
grpc_metadata_batch* dest = (other == nullptr) ? &s->write_buffer_trailing_md
: &other->to_read_trailing_md;
grpc_metadata_batch* dest = (other == nullptr)
? &s->write_buffer_trailing_md
: &other->to_read_trailing_md;
bool* destfilled = (other == nullptr) ? &s->write_buffer_trailing_md_filled
: &other->to_read_trailing_md_filled;
: &other->to_read_trailing_md_filled;
if (*destfilled || s->trailing_md_sent) {
// The buffer is already in use; that's an error!
INPROC_LOG(GPR_DEBUG, "Extra trailing metadata %p", s);
@ -827,10 +829,11 @@ static bool cancel_stream_locked(grpc_exec_ctx* exec_ctx, inproc_stream* s,
grpc_metadata_batch_init(&cancel_md);
inproc_stream* other = s->other_side;
grpc_metadata_batch* dest = (other == nullptr) ? &s->write_buffer_trailing_md
: &other->to_read_trailing_md;
grpc_metadata_batch* dest = (other == nullptr)
? &s->write_buffer_trailing_md
: &other->to_read_trailing_md;
bool* destfilled = (other == nullptr) ? &s->write_buffer_trailing_md_filled
: &other->to_read_trailing_md_filled;
: &other->to_read_trailing_md_filled;
fill_in_metadata(exec_ctx, s, &cancel_md, 0, dest, nullptr, destfilled);
grpc_metadata_batch_destroy(exec_ctx, &cancel_md);
@ -914,12 +917,14 @@ static void perform_stream_op(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Endpoint already shutdown");
}
if (error == GRPC_ERROR_NONE && op->send_initial_metadata) {
grpc_metadata_batch* dest = (other == nullptr) ? &s->write_buffer_initial_md
: &other->to_read_initial_md;
uint32_t* destflags = (other == nullptr) ? &s->write_buffer_initial_md_flags
: &other->to_read_initial_md_flags;
grpc_metadata_batch* dest = (other == nullptr)
? &s->write_buffer_initial_md
: &other->to_read_initial_md;
uint32_t* destflags = (other == nullptr)
? &s->write_buffer_initial_md_flags
: &other->to_read_initial_md_flags;
bool* destfilled = (other == nullptr) ? &s->write_buffer_initial_md_filled
: &other->to_read_initial_md_filled;
: &other->to_read_initial_md_filled;
if (*destfilled || s->initial_md_sent) {
// The buffer is already in use; that's an error!
INPROC_LOG(GPR_DEBUG, "Extra initial metadata %p", s);

@ -198,7 +198,8 @@ static void cover_self(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
grpc_executor_scheduler(GRPC_EXECUTOR_LONG)),
GRPC_ERROR_NONE);
} else {
while ((p = (backup_poller*)gpr_atm_acq_load(&g_backup_poller)) == nullptr) {
while ((p = (backup_poller*)gpr_atm_acq_load(&g_backup_poller)) ==
nullptr) {
// spin waiting for backup poller
}
}

@ -1909,8 +1909,8 @@ static grpc_call_error call_start_batch(grpc_exec_ctx* exec_ctx,
if (!prepare_application_metadata(
exec_ctx, call,
(int)op->data.send_status_from_server.trailing_metadata_count,
op->data.send_status_from_server.trailing_metadata, 1, 1, nullptr,
0)) {
op->data.send_status_from_server.trailing_metadata, 1, 1,
nullptr, 0)) {
for (int n = 0; n < call->send_extra_metadata_count; n++) {
GRPC_MDELEM_UNREF(exec_ctx, call->send_extra_metadata[n].md);
}

Loading…
Cancel
Save