Commit d1a2d1b8 authored by liuzhiweihome's avatar liuzhiweihome

fix _avg_latency maybe zero

parent c90c58b7
......@@ -457,6 +457,9 @@ int64_t LocalityAwareLoadBalancer::Weight::Update(
// or time skews, we don't update the weight for safety.
return 0;
}
if (_avg_latency == 0) {
return 0;
}
_base_weight = scaled_qps / _avg_latency;
return ResetWeight(index, end_time_us);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment