diff --git a/Changes b/Changes index bb2a44c3d..8f16347a6 100644 --- a/Changes +++ b/Changes @@ -33,6 +33,7 @@ netdiscovery/netinventory: * Fix LLDP support * Update timeout to backend-collect-timeout configuration when scanning ESX or RemoteInventory after a successful scan requested by ToolBox +* Fix possible concurrency error leading to an unrecoverable blocked task esx: * Fix first connection timeout support diff --git a/lib/GLPI/Agent/Task/NetDiscovery.pm b/lib/GLPI/Agent/Task/NetDiscovery.pm index efaa3f13e..d19526d8c 100644 --- a/lib/GLPI/Agent/Task/NetDiscovery.pm +++ b/lib/GLPI/Agent/Task/NetDiscovery.pm @@ -300,7 +300,9 @@ sub run { # Enqueue as ip as possible for each job foreach my $jobid (@jobs) { - my $job = $jobs{$jobid}; + # job may has just been done & deleted in run_on_finish() manager callback + my $job = $jobs{$jobid} + or next; next unless $job->ranges; next if $job->max_in_queue; my $range = $job->range; diff --git a/lib/GLPI/Agent/Task/NetInventory.pm b/lib/GLPI/Agent/Task/NetInventory.pm index 9abedf355..5025cd16b 100644 --- a/lib/GLPI/Agent/Task/NetInventory.pm +++ b/lib/GLPI/Agent/Task/NetInventory.pm @@ -209,7 +209,9 @@ sub run { # Enqueue as device as possible for each job foreach my $pid (@pids) { - my $job = $jobs{$pid}; + # job may has just been done & deleted in run_on_finish() manager callback + my $job = $jobs{$pid} + or next; next if $job->no_more || $job->max_in_queue; my $device = $job->nextdevice or next;