Skip to content

Commit

Permalink
fix: Fix possible concurrency error leading to a netdiscovery or neti…
Browse files Browse the repository at this point in the history
…nventory blocked task
  • Loading branch information
g-bougard committed Dec 12, 2023
1 parent ee10761 commit 97ce49d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lib/GLPI/Agent/Task/NetDiscovery.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion lib/GLPI/Agent/Task/NetInventory.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 97ce49d

Please sign in to comment.