A platform for community discussion. Free, open, simple.
DEV: Fix duplicated logging of unicorn worker backtraces (#30178)
Alan Guo Xiang Tan2f65f36caeb5
diff --git a/config/unicorn.conf.rb b/config/unicorn.conf.rbindex 8db561ba17e..62f06167e84 100644--- a/config/unicorn.conf.rb+++ b/config/unicorn.conf.rb@@ -131,9 +131,12 @@ before_fork do |server, worker|tmp = @timeout - diff# START MONKEY PATCH- if tmp < 2- logger.error "worker=#{worker.nr} PID:#{wpid} running too long " \- "(#{diff}s), sending USR2 to dump thread backtraces"+ if tmp < 2 && !worker.instance_variable_get(:@timing_out_logged)+ logger.error do+ "worker=#{worker.nr} PID:#{wpid} running too long (#{diff}s), sending USR2 to dump thread backtraces"+ end++ worker.instance_variable_set(:@timing_out_logged, true)kill_worker(:USR2, wpid)end# END MONKEY PATCH