summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-08-26 14:57:59 +0100
committerSean McGivern <sean@gitlab.com>2019-08-27 14:15:25 +0100
commit7f102819a56b55607e657447b51d2eeb45b2fe94 (patch)
treecd0cbf4d2c45d7beabc2663c00d1b00f5fc83cdc /lib
parent7671c592f826f44be5a8a7dc947fba467f5df851 (diff)
downloadgitlab-ce-7f102819a56b55607e657447b51d2eeb45b2fe94.tar.gz
Fix Peek on Puma
Peek's `Peek.request_id` method doesn't work well with a multi-threaded server and concurrent requests, because requests can 'steal' another request's ID, or unset it before it was due. The upstream change resolves this; the commit here is just to ensure that GitLab works with that upstream change, mostly by not using `Peek.request_id` any more (as the method doesn't exist).
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb b/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb
index 2d997760c46..9595ced0177 100644
--- a/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb
+++ b/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb
@@ -4,8 +4,8 @@
module Gitlab
module PerformanceBar
module RedisAdapterWhenPeekEnabled
- def save
- super unless ::Peek.request_id.blank?
+ def save(request_id)
+ super if ::Peek.enabled? && request_id.present?
end
end
end