Skip to content

Commit

Permalink
Delete container objects when the server is shutting down
Browse files Browse the repository at this point in the history
Before this, when #stop_worker was called, we would attempt to scale
the deployment. This would work if we had a different number (or zero)
workers configured in the settings, but we don't shut workers down
like that when shutting down the server to preserve the user's settings
for the next startup.

This resulted in worker pods not exiting when the orchestrator pod
stopped and much confusion when the next orchestrator started up.
  • Loading branch information
carbonin committed Feb 22, 2018
1 parent ab4df0b commit 37f03a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/miq_server/worker_management/monitor/quiesce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def quiesce_workers_loop
@quiesce_loop_timeout = @worker_monitor_settings[:quiesce_loop_timeout] || 5.minutes
worker_monitor_poll = (@worker_monitor_settings[:poll] || 1.seconds).to_i_with_method

miq_workers.each { |w| stop_worker(w) }
miq_workers.each do |w|
MiqEnvironment::Command.is_podified? && w.containerized_worker? ? w.delete_container_objects : stop_worker(w)
end

loop do
reload # Reload from SQL this MiqServer AND its miq_workers association
break if self.workers_quiesced?
Expand Down

0 comments on commit 37f03a8

Please sign in to comment.