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($@) { ...@@ -1035,16 +1035,16 @@ sub removeVlan($@) {
my $self = shift; my $self = shift;
my @vlan_numbers = @_; my @vlan_numbers = @_;
#
# Need to lock the VLAN edit buffer
#
if (!$self->vlanLock()) {
return 0;
}
my $errors = 0; my $errors = 0;
foreach my $vlan_number (@vlan_numbers) { foreach my $vlan_number (@vlan_numbers) {
#
# Need to lock the VLAN edit buffer
#
if (!$self->vlanLock()) {
return 0;
}
# #
# Make sure the VLAN actually exists # Make sure the VLAN actually exists
# #
...@@ -1067,12 +1067,13 @@ sub removeVlan($@) { ...@@ -1067,12 +1067,13 @@ sub removeVlan($@) {
print "Failed.\n"; print "Failed.\n";
$errors++; $errors++;
} }
}
# #
# Unlock whether successful or not # Unlock whether successful or not
# #
$self->vlanUnlock(); $self->vlanUnlock();
}
if ($errors) { if ($errors) {
return 0; 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