# HG changeset patch
# User Nikola Milojevic <nmilojevic@gitlab.com>
# Date 1683528592 0
#      Mon May 08 06:49:52 2023 +0000
# Node ID de7b58e3d385d3536b4e47e38b616b687f13fece
# Parent  cc1727fe0d7f01e49f3b0ce453662e7bf1257c68
Remove puma_worker_killer

Changelog: removed

diff --git a/files/gitlab-cookbooks/gitlab/templates/default/puma.rb.erb b/files/gitlab-cookbooks/gitlab/templates/default/puma.rb.erb
--- a/files/gitlab-cookbooks/gitlab/templates/default/puma.rb.erb
+++ b/files/gitlab-cookbooks/gitlab/templates/default/puma.rb.erb
@@ -79,14 +79,6 @@
 options = { workers: <%= @worker_processes %> }
 
 before_fork do
-  enable_puma_worker_killer = !Gitlab::Utils.to_boolean(ENV['DISABLE_PUMA_WORKER_KILLER'])
-
-  if enable_puma_worker_killer
-    args = {}
-    args[:puma_per_worker_max_memory_mb] = ENV['PUMA_WORKER_MAX_MEMORY'].to_i if ENV['PUMA_WORKER_MAX_MEMORY']
-    Gitlab::Cluster::PumaWorkerKillerInitializer.start(options, **args)
-  end
-
   # Signal application hooks that we're about to fork
   Gitlab::Cluster::LifecycleEvents.do_before_fork
 end
diff --git a/spec/chef/cookbooks/gitlab/resources/puma_config_spec.rb b/spec/chef/cookbooks/gitlab/resources/puma_config_spec.rb
--- a/spec/chef/cookbooks/gitlab/resources/puma_config_spec.rb
+++ b/spec/chef/cookbooks/gitlab/resources/puma_config_spec.rb
@@ -23,8 +23,6 @@
         expect(content).to match(%r(^directory '/var/opt/gitlab/gitlab-rails/working'))
         expect(content).to match(%r(^require_relative "/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/cluster/lifecycle_events"$))
         expect(content).to match(/^options = { workers: 2 }$/)
-        expect(content).to match(%r(puma_per_worker_max_memory_mb))
-        expect(content).to match(%r(Gitlab::Cluster::PumaWorkerKillerInitializer.start\(options, \*\*args\)))
         expect(content).to match(/^preload_app!$/)
         expect(content).to match(%r(^require_relative "/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/puma_logging/json_formatter"$))
       }