diff options
author | 2017-11-17 16:16:06 -0800 | |
---|---|---|
committer | 2017-11-17 16:17:21 -0800 | |
commit | 0392f8acc33a89fe7d255e6cda0f96eb3a0ec6ab (patch) | |
tree | 51234a00cf528a1fdf8e73cad2cc459925b1673c /src/core/ext | |
parent | aa3b19741f345faa3eb3d9bdcfa9d7064e5c439c (diff) | |
parent | 90c8cf6acc698ddef1d2da3b205ad8d0014b52fa (diff) |
Merge branch 'master' of https://github.com/grpc/grpc into tracing++
Diffstat (limited to 'src/core/ext')
5 files changed, 19 insertions, 11 deletions
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 9b0cf58511..5fb502e2dd 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -1342,6 +1342,9 @@ static void client_load_report_done_locked(grpc_exec_ctx* exec_ctx, void* arg, glb_policy->client_load_report_timer_pending = false; GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &glb_policy->base, "client_load_report"); + if (glb_policy->lb_call == nullptr) { + maybe_restart_lb_call(exec_ctx, glb_policy); + } return; } schedule_next_client_load_report(exec_ctx, glb_policy); diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 54866f2a5d..b15ca82810 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -304,20 +304,20 @@ static void pf_update_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy, p, p->selected->subchannel, i, subchannel_list->num_subchannels); } - grpc_lb_subchannel_list_ref_for_connectivity_watch( - subchannel_list, "connectivity_watch+replace_selected"); - grpc_lb_subchannel_data_start_connectivity_watch(exec_ctx, sd); - if (p->subchannel_list != nullptr) { - grpc_lb_subchannel_list_shutdown_and_unref( - exec_ctx, p->subchannel_list, "pf_update_includes_selected"); - } - p->subchannel_list = subchannel_list; if (p->selected->connected_subchannel != nullptr) { sd->connected_subchannel = GRPC_CONNECTED_SUBCHANNEL_REF( p->selected->connected_subchannel, "pf_update_includes_selected"); } p->selected = sd; + if (p->subchannel_list != nullptr) { + grpc_lb_subchannel_list_shutdown_and_unref( + exec_ctx, p->subchannel_list, "pf_update_includes_selected"); + } + p->subchannel_list = subchannel_list; destroy_unselected_subchannels_locked(exec_ctx, p); + grpc_lb_subchannel_list_ref_for_connectivity_watch( + subchannel_list, "connectivity_watch+replace_selected"); + grpc_lb_subchannel_data_start_connectivity_watch(exec_ctx, sd); // If there was a previously pending update (which may or may // not have contained the currently selected subchannel), drop // it, so that it doesn't override what we've done here. diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index 7271559432..7846576c11 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -431,7 +431,10 @@ static grpc_ares_request* grpc_dns_lookup_ares_impl( } if (service_config_json != nullptr) { grpc_ares_request_ref(r); - ares_search(*channel, hr->host, ns_c_in, ns_t_txt, on_txt_done_cb, r); + char* config_name; + gpr_asprintf(&config_name, "_grpc_config.%s", host); + ares_search(*channel, config_name, ns_c_in, ns_t_txt, on_txt_done_cb, r); + gpr_free(config_name); } /* TODO(zyc): Handle CNAME records here. */ grpc_ares_ev_driver_start(exec_ctx, r->ev_driver); diff --git a/src/core/ext/transport/chttp2/transport/flow_control.cc b/src/core/ext/transport/chttp2/transport/flow_control.cc index bc4e0f9e22..8a057bd9ff 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.cc +++ b/src/core/ext/transport/chttp2/transport/flow_control.cc @@ -314,7 +314,9 @@ double TransportFlowControl::SmoothLogBdp(grpc_exec_ctx* exec_ctx, double bdp_error = value - pid_controller_.last_control_value(); const double dt = (double)(now - last_pid_update_) * 1e-3; last_pid_update_ = now; - return pid_controller_.Update(bdp_error, dt); + // Limit dt to 100ms + const double kMaxDt = 0.1; + return pid_controller_.Update(bdp_error, dt > kMaxDt ? kMaxDt : dt); } FlowControlAction::Urgency TransportFlowControl::DeltaUrgency( diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index 12249991ca..15869b8880 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -318,7 +318,7 @@ class DataSendContext { GPR_MIN(stream_remote_window(), t_->flow_control->remote_window())); } - bool AnyOutgoing() const { return max_outgoing() != 0; } + bool AnyOutgoing() const { return max_outgoing() > 0; } void FlushCompressedBytes() { uint32_t send_bytes = |