Unverified Commit 73ca08b4 authored by Ge Jun's avatar Ge Jun Committed by GitHub

Merge pull request #895 from liuzhiwei/master

fix _avg_latency maybe zero
parents 8199994e bdf271cc
......@@ -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