diff options
author | David Garcia Quintas <dgq@google.com> | 2017-11-09 10:27:00 -0800 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2017-11-09 10:27:00 -0800 |
commit | a5c2d6b234144647d340546b08052e645da186c3 (patch) | |
tree | 2b35efe39c688b63667906ee30c8458253be446f | |
parent | 2da79b8febc7e63994ee19ba4b0f43312050ea78 (diff) |
Don't expect LB call to be NULL inside LB call retry timer.
The timer callback runs independently of query_for_backends_locked()
(which initializes the LB call). It's possible for the timer callback to
fire right after query_for_backends_locked() has initialized the LB
call. These changes makes the timer cb be a no-op in that scenario.
-rw-r--r-- | src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc | 5 |
1 files changed, 3 insertions, 2 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 01b243bc3e..6e4276ce3d 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 @@ -1264,8 +1264,9 @@ static void lb_call_on_retry_timer_locked(grpc_exec_ctx* exec_ctx, void* arg, gpr_log(GPR_INFO, "Restaring call to LB server (grpclb %p)", (void*)glb_policy); } - GPR_ASSERT(glb_policy->lb_call == NULL); - query_for_backends_locked(exec_ctx, glb_policy); + if (glb_policy->lb_call == NULL) { + query_for_backends_locked(exec_ctx, glb_policy); + } } GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &glb_policy->base, "grpclb_retry_timer"); } |