Skip to content

Commit fbb9a74

Browse files
committed
Update puma.rb
1 parent b2062dd commit fbb9a74

File tree

1 file changed

+17
-1
lines changed
  • assets/runtime/config/gitlabhq

1 file changed

+17
-1
lines changed

assets/runtime/config/gitlabhq/puma.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
workers {{PUMA_WORKERS}}
4040

4141
require_relative "{{GITLAB_INSTALL_DIR}}/lib/gitlab/cluster/lifecycle_events"
42-
require_relative "{{GITLAB_INSTALL_DIR}}/lib/gitlab/cluster/puma_worker_killer_initializer"
4342

4443
on_restart do
4544
# Signal application hooks that we're about to restart
@@ -60,6 +59,11 @@
6059
Gitlab::Cluster::LifecycleEvents.do_worker_start
6160
end
6261

62+
on_worker_shutdown do
63+
# Signal application hooks that a worker is shutting down
64+
Gitlab::Cluster::LifecycleEvents.do_worker_stop
65+
end
66+
6367
# Preload the application before starting the workers; this conflicts with
6468
# phased restart feature. (off by default)
6569
preload_app!
@@ -72,10 +76,22 @@
7276
#
7377
worker_timeout {{PUMA_TIMEOUT}}
7478

79+
# https://github.com/puma/puma/blob/master/5.0-Upgrade.md#lower-latency-better-throughput
80+
wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LESS_BUSY_WORKER', 0.001).to_f
81+
7582
# Use json formatter
7683
require_relative "{{GITLAB_INSTALL_DIR}}/lib/gitlab/puma_logging/json_formatter"
7784

7885
json_formatter = Gitlab::PumaLogging::JSONFormatter.new
7986
log_formatter do |str|
8087
json_formatter.call(str)
8188
end
89+
90+
lowlevel_error_handler do |ex, env|
91+
if Raven.configuration.capture_allowed?
92+
Raven.capture_exception(ex, tags: { 'handler': 'puma_low_level' }, extra: { puma_env: env })
93+
end
94+
95+
# note the below is just a Rack response
96+
[500, {}, ["An error has occurred and reported in the system's low-level error handler."]]
97+
end

0 commit comments

Comments
 (0)