Deadlock in Discover over access to the device_ports table

This commit is contained in:
Oliver Gorwits
2013-10-15 21:35:26 +01:00
parent a3835798b7
commit ac1b77d44a
2 changed files with 5 additions and 2 deletions

View File

@@ -749,9 +749,11 @@ sub _set_manual_topology {
schema('netdisco')->txn_do(sub {
# clear manual topology flags
schema('netdisco')->resultset('DevicePort')->update({manual_topo => \'false'});
schema('netdisco')->resultset('DevicePort')
->search({ip => $device->ip})->update({manual_topo => \'false'});
my $topo_links = schema('netdisco')->resultset('Topology');
my $topo_links = schema('netdisco')->resultset('Topology')
->search({-or => [dev1 => $device->ip, dev2 => $device->ip]});
debug sprintf ' [%s] neigh - setting manual topology links', $device->ip;
while (my $link = $topo_links->next) {