Merge branch 'fix/sidekiq-mem-killer-debug' into 'master'

Better debugging for memory killer middleware

This adds more info to the warning messages output by `MemoryKiller`.

Previously only the PID was showed, making it difficult to debug issues like https://gitlab.com/gitlab-org/gitlab-ce/issues/19124

This adds the worker class and job ID to the log messages.

See merge request !4936
This commit is contained in:
Rémy Coutable 2016-06-27 15:47:16 +00:00
commit 3659992cd5
1 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ module Gitlab
Sidekiq.logger.warn "current RSS #{current_rss} exceeds maximum RSS "\
"#{MAX_RSS}"
Sidekiq.logger.warn "this thread will shut down PID #{Process.pid} "\
Sidekiq.logger.warn "this thread will shut down PID #{Process.pid} - Worker #{worker.class} - JID-#{job['jid']}"\
"in #{GRACE_TIME} seconds"
sleep(GRACE_TIME)
@ -36,7 +36,7 @@ module Gitlab
"#{SHUTDOWN_SIGNAL} to PID #{Process.pid}"
sleep(SHUTDOWN_WAIT)
Sidekiq.logger.warn "sending #{SHUTDOWN_SIGNAL} to PID #{Process.pid}"
Sidekiq.logger.warn "sending #{SHUTDOWN_SIGNAL} to PID #{Process.pid} - Worker #{worker.class} - JID-#{job['jid']}"
Process.kill(SHUTDOWN_SIGNAL, Process.pid)
end
end