Skip to content

Commit cf19433

Browse files
committed
Kill collector thread after stopping timeout
1 parent efb7b85 commit cf19433

File tree

1 file changed

+8
-1
lines changed
  • app/models/manageiq/providers/vmware/infra_manager/inventory

1 file changed

+8
-1
lines changed

app/models/manageiq/providers/vmware/infra_manager/inventory/collector.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ def stop(join_timeout = 2.minutes)
2828

2929
# The WaitOptions for WaitForUpdatesEx call sets maxWaitSeconds to 60 seconds
3030
self.exit_requested = true
31-
vim_thread&.join(join_timeout)
31+
32+
if vim_thread
33+
# Give the collector thread a chance to exit cleanly, then kill it to
34+
# ensure we don't have multiple collector threads running.
35+
result = vim_thread.join(join_timeout)
36+
vim_thread.kill if result.nil?
37+
end
38+
3239
self.exit_requested = false
3340
end
3441

0 commit comments

Comments
 (0)