-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't run the broker for ems_inventory if update_driven_refresh is set #15579
Don't run the broker for ems_inventory if update_driven_refresh is set #15579
Conversation
74d5448
to
70f7d17
Compare
70f7d17
to
cc78b66
Compare
These failures in Travis look legit |
app/models/miq_vim_broker_worker.rb
Outdated
|
||
roles << 'ems_inventory' unless Settings.prototype.ems_vmware.update_driven_refresh | ||
|
||
roles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A visually nicer pattern might be
%w(
ems_metrics_collector
ems_operations
smartproxy
smartstate
).tap do |roles|
roles << 'ems_inventory' unless Settings.prototype.ems_vmware.update_driven_refresh
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 will do
Yeah that's because the setting doesn't exist until ManageIQ/manageiq-providers-vmware#76 adds it |
cc78b66
to
94d85ed
Compare
Checked commits agrare/manageiq@153cf09~...94d85ed with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/miq_ems_refresh_core_worker.rb
app/models/miq_vim_broker_worker.rb
app/models/miq_vim_broker_worker/runner.rb
|
smartproxy | ||
smartstate | ||
).tap do |roles| | ||
roles << 'ems_inventory' unless Settings.prototype.try(:ems_vmware).try(:update_driven_refresh) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused why you have to do this as well as check the setting and role in the has_ems_inventory_role?
method in the runner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of this is to control if the broker should start or not, the check in the runner is to control the cache_scope once it has started. Some examples would probably help.
Assuming you're using update_driven_refresh
:
-
The only active role on this appliance is
ems_inventory
In this case the broker shouldn't even start, that's what the above block handles -
There are e.g. ems_operations and ems_inventory roles active
In this case we do want to start the broker to handle the ems_operations role but without checking the setting in the runner it would usecache_scope_ems_refresh
which uses a lot more memory and defeat the purpose. This is what the check in the runner handles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
If using
WaitForUpdates
inventory collection then disableMiqEmsRefreshCoreWorker
and don't run theMiqVimBrokerWorker
for theems_inventory
role.