diff --git a/assets/runtime/config/gitlabhq/unicorn.rb b/assets/runtime/config/gitlabhq/unicorn.rb index ee8c0cf9..3d62d74d 100644 --- a/assets/runtime/config/gitlabhq/unicorn.rb +++ b/assets/runtime/config/gitlabhq/unicorn.rb @@ -120,6 +120,10 @@ after_fork do |server, worker| # the following is *required* for Rails + "preload_app true", defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection + + # reset prometheus client, this will cause any opened metrics files to be closed + defined?(::Prometheus::Client.reinitialize_on_pid_change) && + Prometheus::Client.reinitialize_on_pid_change # if preload_app is true, then you may also want to check and # restart any other shared sockets/descriptors such as Memcached,