Commit 6e39f039 authored by zhujiashun's avatar zhujiashun

fix lalb be disabled wrongly

parent 40b13429
......@@ -555,7 +555,7 @@ LocalityAwareLoadBalancer::Weight::~Weight() {
int64_t LocalityAwareLoadBalancer::Weight::Disable() {
BAIDU_SCOPED_LOCK(_mutex);
const int64_t saved = _weight;
_base_weight = 0;
_base_weight = -1;
_weight = 0;
return saved;
}
......
......@@ -86,7 +86,7 @@ private:
void Describe(std::ostream& os, int64_t now);
int64_t Disable();
bool Disabled() const { return _base_weight == 0; }
bool Disabled() const { return _base_weight == -1; }
int64_t MarkOld(size_t index);
std::pair<int64_t, int64_t> ClearOld();
......
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