aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2017-07-12 15:26:55 -0700
committerGravatar Mark D. Roth <roth@google.com>2017-07-12 15:26:55 -0700
commit15494b5d3e2b4ed8d8dc2243f32d06c41d668e9d (patch)
treecf330013f0cffb7689ffe7784f286acd36f5f3ed /src
parent102efba80bff45c6083c376459755bc15818ad33 (diff)
Don't set the channel's state to TRANSIENT_FAILURE if we updated the LB policy.
Diffstat (limited to 'src')
-rw-r--r--src/core/ext/filters/client_channel/client_channel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/ext/filters/client_channel/client_channel.c b/src/core/ext/filters/client_channel/client_channel.c
index 7add432589..a383d4f678 100644
--- a/src/core/ext/filters/client_channel/client_channel.c
+++ b/src/core/ext/filters/client_channel/client_channel.c
@@ -370,6 +370,7 @@ static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx,
grpc_error_string(error));
}
// Extract the following fields from the resolver result, if non-NULL.
+ bool lb_policy_updated = false;
char *lb_policy_name = NULL;
bool lb_policy_name_changed = false;
grpc_lb_policy *new_lb_policy = NULL;
@@ -424,6 +425,7 @@ static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx,
strcmp(chand->info_lb_policy_name, lb_policy_name) != 0;
if (chand->lb_policy != NULL && !lb_policy_name_changed) {
// Continue using the same LB policy. Update with new addresses.
+ lb_policy_updated = true;
grpc_lb_policy_update_locked(exec_ctx, chand->lb_policy, &lb_policy_args);
} else {
// Instantiate new LB policy.
@@ -569,8 +571,11 @@ static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx,
}
watch_lb_policy_locked(exec_ctx, chand, new_lb_policy, state);
}
- set_channel_connectivity_state_locked(
- exec_ctx, chand, state, GRPC_ERROR_REF(state_error), "new_lb+resolver");
+ if (!lb_policy_updated) {
+ set_channel_connectivity_state_locked(exec_ctx, chand, state,
+ GRPC_ERROR_REF(state_error),
+ "new_lb+resolver");
+ }
grpc_resolver_next_locked(exec_ctx, chand->resolver,
&chand->resolver_result,
&chand->on_resolver_result_changed);