diff --git a/config/puma.example.development.rb b/config/puma.example.development.rb index 71a4e9b36f1e21b54b3b5eb332f943e83ff69f1a..1b75238112f0cf290baf38325440edd52e03e28f 100644 --- a/config/puma.example.development.rb +++ b/config/puma.example.development.rb @@ -88,8 +88,12 @@ # https://github.com/puma/puma/blob/master/5.0-Upgrade.md#lower-latency-better-throughput wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LESS_BUSY_WORKER', 0.001).to_f +# nakayoshi_fork was removed in Puma 6.0: https://github.com/puma/puma/issues/2258 # https://github.com/puma/puma/blob/master/5.0-Upgrade.md#nakayoshi_fork -nakayoshi_fork unless ENV['DISABLE_PUMA_NAKAYOSHI_FORK'] == 'true' +if Gem::Version.new(Puma::Const::PUMA_VERSION).canonical_segments.first == 5 && + ENV['DISABLE_PUMA_NAKAYOSHI_FORK'] != 'true' + nakayoshi_fork +end # Use json formatter require_relative "/home/git/gitlab/lib/gitlab/puma_logging/json_formatter" diff --git a/config/puma.rb.example b/config/puma.rb.example index 59844b4aecffe16b1ef58714f870cc00b5361776..d474fc70500085480bf02aa4e8d105ca8230b27a 100644 --- a/config/puma.rb.example +++ b/config/puma.rb.example @@ -77,8 +77,12 @@ worker_timeout 60 # https://github.com/puma/puma/blob/master/5.0-Upgrade.md#lower-latency-better-throughput wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LESS_BUSY_WORKER', 0.001).to_f +# nakayoshi_fork was removed in Puma 6.0: https://github.com/puma/puma/issues/2258 # https://github.com/puma/puma/blob/master/5.0-Upgrade.md#nakayoshi_fork -nakayoshi_fork unless ENV['DISABLE_PUMA_NAKAYOSHI_FORK'] == 'true' +if Gem::Version.new(Puma::Const::PUMA_VERSION).canonical_segments.first == 5 && + ENV['DISABLE_PUMA_NAKAYOSHI_FORK'] != 'true' + nakayoshi_fork +end # Use json formatter require_relative "/home/git/gitlab/lib/gitlab/puma_logging/json_formatter"