Skip to content

Commit

Permalink
Merge pull request #15827 from NickLaMuro/run_single_worker_handle_si…
Browse files Browse the repository at this point in the history
…gterm_bugfix

Fix minor typos/issues with PR #15818
  • Loading branch information
jrafanie authored Aug 17, 2017
2 parents 02cfa8f + 124cdd9 commit d507edb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/models/miq_worker/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def initialize(cfg = {})
$log ||= Rails.logger

@server = MiqServer.my_server(true)
@sigterm_received = false

worker_initialization
after_initialize
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -495,8 +496,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
Expand Down

0 comments on commit d507edb

Please sign in to comment.