Skip to content
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

settings.yml support string settings values #20908

Merged
merged 2 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/miq_worker/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.start_worker(*args)

def poll_method
return @poll_method unless @poll_method.nil?
self.poll_method = worker_settings[:poll_method]
self.poll_method = worker_settings[:poll_method]&.to_sym
end

def poll_method=(val)
Expand Down
18 changes: 9 additions & 9 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -963,13 +963,13 @@
:worker_monitor:
:enforce_resource_constraints: false
:kill_algorithm:
:name: :used_swap_percent_gt_value
:name: used_swap_percent_gt_value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the caller not care if it's symbol or string? (same with the other algorithms). Asking because I don't see a corresponding code change like what you did for poll_method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked, it uses send so it should be ok.

:value: 80
:miq_server_time_threshold: 2.minutes
:nice_delta: 1
:poll: 2.seconds
:start_algorithm:
:name: :used_swap_percent_lt_value
:name: used_swap_percent_lt_value
:value: 60
:sync_interval: 30.minutes
:wait_for_started_timeout: 10.minutes
Expand Down Expand Up @@ -1064,7 +1064,7 @@
:parent_time_threshold: 3.minutes
:poll: 3.seconds
:poll_escalate_max: 30.seconds
:poll_method: :normal
:poll_method: normal
:starting_timeout: 10.minutes
:stopping_timeout: 10.minutes
:systemd_enabled: true
Expand All @@ -1083,28 +1083,28 @@
:poll: 10.seconds
:queue_worker_base:
:defaults:
:dequeue_method: :drb
:poll_method: :normal
:dequeue_method: drb
:poll_method: normal
:queue_timeout: 10.minutes
:ems_metrics_collector_worker:
:defaults:
:count: 2
:nice_delta: 3
:poll_method: :escalate
:poll_method: escalate
:ems_metrics_processor_worker:
:count: 2
:memory_threshold: 800.megabytes
:nice_delta: 7
:poll_method: :escalate
:poll_method: escalate
:ems_operations_worker: {}
:ems_refresh_worker:
:defaults:
:memory_threshold: 2.gigabytes
:nice_delta: 7
:poll: 10.seconds
:poll_method: :normal
:poll_method: normal
:queue_timeout: 120.minutes
:dequeue_method: :sql
:dequeue_method: sql
:event_handler:
:nice_delta: 7
:generic_worker:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
_, @server, = EvmSpecHelper.create_guid_miq_server_zone
@monitor_settings = YAML.load(<<-EOS
:kill_algorithm:
:name: :used_swap_percent_gt_value
:name: used_swap_percent_gt_value
:value: 80
:start_algorithm:
:name: :used_swap_percent_lt_value
:name: used_swap_percent_lt_value
:value: 60
EOS
)
Expand Down