Commit e5986abc authored by Robert Ricci's avatar Robert Ricci
Browse files

When removing VLANs, get a new lock on the edit buffer for each VLAN

we're going to remove. We used to do all VLANs in one lock for
performace reasons - however, I'm discovering that the lock can get
held for such a long time when many VLANs are being deleted that other
VLAN operations, such as listing VLANs, can fail. And, it's not
actually that much slower to grab a new lock each time.
parent af41156b
......@@ -1035,16 +1035,16 @@ sub removeVlan($@) {
my $self = shift;
my @vlan_numbers = @_;
#
# Need to lock the VLAN edit buffer
#
if (!$self->vlanLock()) {
return 0;
}
my $errors = 0;
foreach my $vlan_number (@vlan_numbers) {
#
# Need to lock the VLAN edit buffer
#
if (!$self->vlanLock()) {
return 0;
}
#
# Make sure the VLAN actually exists
#
......@@ -1067,12 +1067,13 @@ sub removeVlan($@) {
print "Failed.\n";
$errors++;
}
}
#
# Unlock whether successful or not
#
$self->vlanUnlock();
#
# Unlock whether successful or not
#
$self->vlanUnlock();
}
if ($errors) {
return 0;
......
Supports Markdown
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