diff options
author | Kristian Lyngstol <kly@kly.no> | 2016-03-17 21:49:58 +0000 |
---|---|---|
committer | Kristian Lyngstol <kly@kly.no> | 2016-03-17 21:49:58 +0000 |
commit | 06b47ddd070fb1b46de53c7187acbf27878b8f07 (patch) | |
tree | b94d7f05ebb51f9117c8997efcf90eaf9cd56e7e | |
parent | ea40d3561f73b5ee6ed9beddcaf19b8bb9e7feb7 (diff) |
NMS: Throw away good sense to avoid deadlock
-rwxr-xr-x | clients/snmpfetchng.pl | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clients/snmpfetchng.pl b/clients/snmpfetchng.pl index 0a52af0..e813499 100755 --- a/clients/snmpfetchng.pl +++ b/clients/snmpfetchng.pl @@ -38,7 +38,6 @@ $qualification ORDER BY overdue DESC LIMIT ? -FOR UPDATE OF switches EOF or die "Couldn't prepare qswitch"; our $qlock = $dbh->prepare("UPDATE switches SET locked='t', last_updated=now() WHERE switch=?") @@ -95,6 +94,7 @@ sub inner_loop $switch{'start'} = time; $qlock->execute($switch{'id'}) or die "Couldn't lock switch"; + $dbh->commit; my $s = SNMP::Session->new(DestHost => $switch{'mgtip'}, Community => $switch{'community'}, UseEnums => 1, @@ -105,7 +105,6 @@ sub inner_loop $outstanding--; } } - $dbh->commit; mylog( "Polling " . @switches . " switches: $poll_todo"); SNMP::MainLoop(5); } |