mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-17 10:19:49 +00:00
Fix unresponsiveness when moving flows in balance-aware (See #1764)
This commit is contained in:
parent
bcf27d78e5
commit
b02a41751c
@ -1374,9 +1374,7 @@ void Bond::processBalanceTasks(int64_t now)
|
|||||||
Mutex::Lock _l(_flows_m);
|
Mutex::Lock _l(_flows_m);
|
||||||
std::map<int16_t, SharedPtr<Flow> >::iterator flow_it = _flows.begin();
|
std::map<int16_t, SharedPtr<Flow> >::iterator flow_it = _flows.begin();
|
||||||
while (flow_it != _flows.end()) {
|
while (flow_it != _flows.end()) {
|
||||||
if (! _paths[flow_it->second->assignedPath].p) {
|
if (_paths[flow_it->second->assignedPath].p) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
int originalPathIdx = flow_it->second->assignedPath;
|
int originalPathIdx = flow_it->second->assignedPath;
|
||||||
if (! _paths[originalPathIdx].eligible) {
|
if (! _paths[originalPathIdx].eligible) {
|
||||||
log("moving all flows from dead link %s", pathToStr(_paths[originalPathIdx].p).c_str());
|
log("moving all flows from dead link %s", pathToStr(_paths[originalPathIdx].p).c_str());
|
||||||
@ -1384,6 +1382,7 @@ void Bond::processBalanceTasks(int64_t now)
|
|||||||
_paths[originalPathIdx].assignedFlowCount--;
|
_paths[originalPathIdx].assignedFlowCount--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
++flow_it;
|
++flow_it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1394,9 +1393,7 @@ void Bond::processBalanceTasks(int64_t now)
|
|||||||
Mutex::Lock _l(_flows_m);
|
Mutex::Lock _l(_flows_m);
|
||||||
std::map<int16_t, SharedPtr<Flow> >::iterator flow_it = _flows.begin();
|
std::map<int16_t, SharedPtr<Flow> >::iterator flow_it = _flows.begin();
|
||||||
while (flow_it != _flows.end()) {
|
while (flow_it != _flows.end()) {
|
||||||
if (! _paths[flow_it->second->assignedPath].p) {
|
if (_paths[flow_it->second->assignedPath].p) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
int originalPathIdx = flow_it->second->assignedPath;
|
int originalPathIdx = flow_it->second->assignedPath;
|
||||||
if (_paths[originalPathIdx].shouldAvoid) {
|
if (_paths[originalPathIdx].shouldAvoid) {
|
||||||
if (assignFlowToBondedPath(flow_it->second, now, true)) {
|
if (assignFlowToBondedPath(flow_it->second, now, true)) {
|
||||||
@ -1404,6 +1401,7 @@ void Bond::processBalanceTasks(int64_t now)
|
|||||||
return; // Only move one flow at a time
|
return; // Only move one flow at a time
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
++flow_it;
|
++flow_it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user