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.
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 01b243b..6e4276c 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 @@
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");
}