summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-07-27 15:47:01 +0000
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2017-07-31 20:39:01 +0100
commit251109716617d372592f78ba6e4fc65a1366a9c4 (patch)
tree02ff44cdfe06bdf98d23a32d14eee8e603e735b3
parent102ab0c970777e9e9acdaf9ca00b1f444d00b6fa (diff)
downloadgitlab-ce-251109716617d372592f78ba6e4fc65a1366a9c4.tar.gz
Merge branch 'pawel/prometheus_client_pid_reuse_error' into 'master'9-4-stable-patch-3
Fix prometheus client pid reuse bug See merge request !13130
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--changelogs/unreleased/pawel-prometheus_client_pid_reuse_error.yml4
-rw-r--r--config/unicorn.rb.example4
4 files changed, 11 insertions, 3 deletions
diff --git a/Gemfile b/Gemfile
index 07ba3de4f55..580c4b0e565 100644
--- a/Gemfile
+++ b/Gemfile
@@ -287,7 +287,7 @@ group :metrics do
gem 'influxdb', '~> 0.2', require: false
# Prometheus
- gem 'prometheus-client-mmap', '~>0.7.0.beta9'
+ gem 'prometheus-client-mmap', '~>0.7.0.beta11'
gem 'raindrops', '~> 0.18'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index e9f20641ee3..c607c7eb3dc 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -596,7 +596,7 @@ GEM
premailer-rails (1.9.7)
actionmailer (>= 3, < 6)
premailer (~> 1.7, >= 1.7.9)
- prometheus-client-mmap (0.7.0.beta10)
+ prometheus-client-mmap (0.7.0.beta11)
mmap2 (~> 2.2, >= 2.2.7)
pry (0.10.4)
coderay (~> 1.1.0)
@@ -1049,7 +1049,7 @@ DEPENDENCIES
pg (~> 0.18.2)
poltergeist (~> 1.9.0)
premailer-rails (~> 1.9.7)
- prometheus-client-mmap (~> 0.7.0.beta9)
+ prometheus-client-mmap (~> 0.7.0.beta11)
pry-byebug (~> 3.4.1)
pry-rails (~> 0.3.4)
rack-attack (~> 4.4.1)
diff --git a/changelogs/unreleased/pawel-prometheus_client_pid_reuse_error.yml b/changelogs/unreleased/pawel-prometheus_client_pid_reuse_error.yml
new file mode 100644
index 00000000000..dfff4c23308
--- /dev/null
+++ b/changelogs/unreleased/pawel-prometheus_client_pid_reuse_error.yml
@@ -0,0 +1,4 @@
+---
+title: Fix Prometheus client PID reuse bug
+merge_request: 13130
+author:
diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example
index 40a16a32359..cc10da2bd88 100644
--- a/config/unicorn.rb.example
+++ b/config/unicorn.rb.example
@@ -121,6 +121,10 @@ after_fork do |server, worker|
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,
# and Redis. TokyoCabinet file handles are safe to reuse