diff --git a/app/models/miq_worker/runner.rb b/app/models/miq_worker/runner.rb index dae0a883b8a..e854074ee90 100644 --- a/app/models/miq_worker/runner.rb +++ b/app/models/miq_worker/runner.rb @@ -48,6 +48,7 @@ def initialize(cfg = {}) $log ||= Rails.logger @server = MiqServer.my_server(true) + @sigterm_received = false worker_initialization after_initialize @@ -343,7 +344,7 @@ def do_work_loop # Should be caught by the rescue in `#start` and will run do_exit from # there. - raise Interrupt if @sigterm_recieved + raise Interrupt if @sigterm_received do_gc self.class.log_ruby_object_usage(worker_settings[:top_ruby_object_classes_to_log].to_i) @@ -469,8 +470,8 @@ def self.log_ruby_object_usage(top = 20) # received from the container management system (aka OpenShift). The SIGINT # trap is mostly a developer convenience. def setup_sigterm_trap - Kernel.trap("TERM") { @sigterm_recieved = true } - Kernel.trap("INT") { @sigterm_recieved = true } + Kernel.trap("TERM") { @sigterm_received = true } + Kernel.trap("INT") { @sigterm_received = true } end protected