diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2019-07-19 10:19:35 +0200 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2019-07-19 10:19:35 +0200 |
commit | ac8f867a740a08741188e7d32cf052a48799adbf (patch) | |
tree | 31527df833a6a1cd9583dc38b04464eb12a851ee | |
parent | f97a73fa39b48b6c3c770d609fcd9584d17221da (diff) | |
download | gitlab-ce-64780-fix_unicorn_hup_crash.tar.gz |
Fix for SIGHUP to unicorn crashes64780-fix_unicorn_hup_crash
-rw-r--r-- | config/unicorn.rb.example | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example index 581fde84c95..cd4c9a01c3e 100644 --- a/config/unicorn.rb.example +++ b/config/unicorn.rb.example @@ -88,17 +88,15 @@ before_exec do |server| Gitlab::Cluster::LifecycleEvents.do_master_restart end -run_once = true - before_fork do |server, worker| - if run_once + unless Unicorn::HttpServer::START_CTX[:gitlab_run_once] # There is a difference between Puma and Unicorn: # - Puma calls before_fork once when booting up master process # - Unicorn runs before_fork whenever new work is spawned # To unify this behavior we call before_fork only once (we use # this callback for deleting Prometheus files so for our purposes # it makes sense to align behavior with Puma) - run_once = false + Unicorn::HttpServer::START_CTX[:gitlab_run_once] = true # Signal application hooks that we're about to fork Gitlab::Cluster::LifecycleEvents.do_before_fork |