diff options
author | Mark D. Roth <roth@google.com> | 2018-03-30 14:44:27 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2018-03-30 14:44:27 -0700 |
commit | db0a475df0f5f866af062177d9e190df9e0a5803 (patch) | |
tree | 8f3d6ab82775edf0dd6bd6e8972da0ab68b48c60 /src/core/ext/filters/client_channel/lb_policy/round_robin | |
parent | 7c1b5db3bb000a7c69d9d8151c66fecbacce64c3 (diff) | |
download | grpc-grpc-db0a475df0f5f866af062177d9e190df9e0a5803.tar.gz |
more WIP
Diffstat (limited to 'src/core/ext/filters/client_channel/lb_policy/round_robin')
-rw-r--r-- | src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index a9d9227ea5..c697ebb402 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -477,10 +477,11 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( if (grpc_lb_round_robin_trace.enabled()) { gpr_log( GPR_DEBUG, - "[RR %p] connectivity changed for subchannel %p, subchannel_list %p: " - "prev_state=%s new_state=%s p->shutdown=%d " - "sd->subchannel_list->shutting_down=%d error=%s", - p, subchannel(), subchannel_list(), + "[RR %p] connectivity changed for subchannel %p, subchannel_list %p " + "(index %" PRIuPTR " of %" PRIuPTR "): prev_state=%s new_state=%s " + "p->shutdown=%d sd->subchannel_list->shutting_down=%d error=%s", + p, subchannel(), subchannel_list(), Index(), + subchannel_list()->num_subchannels(), grpc_connectivity_state_name(prev_connectivity_state_), grpc_connectivity_state_name(connectivity_state()), p->shutdown_, subchannel_list()->shutting_down(), @@ -510,7 +511,6 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( // subchannel, if any. switch (connectivity_state()) { case GRPC_CHANNEL_TRANSIENT_FAILURE: { - clear_connected_subchannel(); if (grpc_lb_round_robin_trace.enabled()) { gpr_log(GPR_DEBUG, "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. " @@ -522,7 +522,7 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked( } case GRPC_CHANNEL_READY: { if (connected_subchannel() == nullptr) { - GetConnectedSubchannelFromSubchannelLocked(); + SetConnectedSubchannelFromSubchannelLocked(); } if (p->subchannel_list_ != subchannel_list()) { // promote subchannel_list() to p->subchannel_list_. @@ -657,13 +657,16 @@ void RoundRobin::UpdateLocked(const grpc_channel_args& args) { } if (started_picking_) { for (size_t i = 0; i < subchannel_list->num_subchannels(); ++i) { +// FIXME: this is wrong, because we should not reset +// curr_connectivity_state_ or pending_connectivity_state_unsafe_ unless +// the new state is TRANSIENT_FAILURE const grpc_connectivity_state subchannel_state = subchannel_list->subchannel(i)->CheckConnectivityStateLocked(); // Override the default setting of IDLE for connectivity notification // purposes if the subchannel is already in transient failure. Otherwise // we'd be immediately notified of the IDLE-TRANSIENT_FAILURE // discrepancy, attempt to re-resolve, and end up here again. -// FIXME +// FIXME: do this // TODO(roth): As part of C++-ifying the subchannel_list API, design a // better API for notifying the LB policy of subchannel states, which can // be used both for the subchannel's initial state and for subsequent |