Skip to content

Commit

Permalink
Add timeout knob for monitoring server roles
Browse files Browse the repository at this point in the history
https://bugzilla.redhat.com/show_bug.cgi?id=1564567

Monitoring server roles as the master server is so important, it should
finish and not ever timeout. If it times out, servers will not be able
to gain roles. Previously, the default lock timeout of 1 minute is too
low in situations where the master server has higher than normal
latency to the database.  We need to give it more time to finish before
timing it out.

Additionally, we can specify this value in advanced settings in the server
section if 5.minutes is still not enough or just a wrong value.
  • Loading branch information
jrafanie committed Apr 10, 2018
1 parent 0eedee8 commit 1f564cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/miq_server/role_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,12 @@ def synchronize_active_roles(servers, roles_to_sync)
end
end

def monitor_server_roles_timeout
::Settings.server.monitor_server_roles_timeout.to_i_with_method
end

def monitor_server_roles
MiqRegion.my_region.lock do |region|
MiqRegion.my_region.lock(:exclusive, monitor_server_roles_timeout) do |region|
region.zones.each do |zone|
synchronize_active_roles(zone.active_miq_servers.includes([:active_roles, :inactive_roles]), ServerRole.zone_scoped_roles)
end
Expand Down
1 change: 1 addition & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@
:mks_classid: 338095E4-1806-4BA3-AB51-38A3179200E9
:mks_version: 2.1.0.0
:monitor_poll: 5.seconds
:monitor_server_roles_timeout: 5.minutes
:prefetch_max_per_worker: 10
:prefetch_max_per_worker_dequeue: 100
:prefetch_min_per_worker_dequeue: 10
Expand Down

0 comments on commit 1f564cd

Please sign in to comment.