Skip to content

Commit

Permalink
Don't start another refresh worker while another is stopping
Browse files Browse the repository at this point in the history
If a RefreshWorker is asked to stop (usually for exceeding memory) we
don't want to start another right away until the first has stopped.

This can lead to many refresh workers running at the same time since the
next worker that starts typically exceeds memory as well and will be
asked to shutdown also.

In addition to using a huge amount of memory
this can also lead to inventory integrity issues since it is possible
for multiple refresh workers to be running save_ems_inventory at once.
  • Loading branch information
agrare committed Mar 22, 2019
1 parent 99e4014 commit 1ab6883
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/manageiq/providers/base_manager/refresh_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ class ManageIQ::Providers::BaseManager::RefreshWorker < MiqQueueWorkerBase

include PerEmsWorkerMixin

# Don't allow multiple refresh workers to run at once
self.include_stopping_workers_on_synchronize = true
self.required_roles = "ems_inventory"

def friendly_name
Expand Down

0 comments on commit 1ab6883

Please sign in to comment.