aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2018-04-26 08:33:27 -0700
committerGravatar Mark D. Roth <roth@google.com>2018-04-26 08:33:27 -0700
commit3e74a1866816779335fdad890a3c927a59df8dad (patch)
treea07dff19d2ad6d6fc88ae210d809ad90aa42693f /src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
parentb1c1309bfcbe7d8834965169d9e527528d477c2e (diff)
Minor cleanups.
Diffstat (limited to 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h')
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/subchannel_list.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
index 8b843b16c0..6d9c382c64 100644
--- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
+++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
@@ -94,13 +94,14 @@ class SubchannelData {
return curr_connectivity_state_;
}
-// FIXME: remove
- // An alternative to SetConnectedSubchannelFromSubchannelLocked() for
- // cases where we are retaining a connected subchannel from a previous
- // subchannel list. This is slightly more efficient than getting the
- // connected subchannel from the subchannel, because that approach
- // requires the use of a mutex, whereas this one only mutates a
- // refcount.
+ // Used to set the connected subchannel in cases where we are retaining a
+ // subchannel from a previous subchannel list. This is slightly more
+ // efficient than getting the connected subchannel from the subchannel,
+ // because that approach requires the use of a mutex, whereas this one
+ // only mutates a refcount.
+ // TODO(roth): This method is a bit of a hack and is used only in
+ // pick_first. When we have time, find a way to remove this, possibly
+ // by making pick_first work more like round_robin.
void SetConnectedSubchannelFromLocked(SubchannelData* other) {
GPR_ASSERT(subchannel_ == other->subchannel_);
connected_subchannel_ = other->connected_subchannel_; // Adds ref.
@@ -164,11 +165,12 @@ class SubchannelData {
// Implementations can use connectivity_state() to get the new
// connectivity state.
// Implementations must invoke either StopConnectivityWatch() or again
- // call StartConnectivityWatch() before returning.
+ // call StartOrRenewConnectivityWatch() before returning.
virtual void ProcessConnectivityChangeLocked(grpc_error* error) GRPC_ABSTRACT;
private:
-// FIXME: document
+ // Updates connected_subchannel_ based on pending_connectivity_state_unsafe_.
+ // Returns true if the connectivity state should be reported.
bool UpdateConnectedSubchannelLocked();
static void OnConnectivityChangedLocked(void* arg, grpc_error* error);