From 7f102819a56b55607e657447b51d2eeb45b2fe94 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Mon, 26 Aug 2019 14:57:59 +0100 Subject: 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). --- app/controllers/concerns/with_performance_bar.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/controllers') diff --git a/app/controllers/concerns/with_performance_bar.rb b/app/controllers/concerns/with_performance_bar.rb index 4e0ae3c59eb..b19d6eb9439 100644 --- a/app/controllers/concerns/with_performance_bar.rb +++ b/app/controllers/concerns/with_performance_bar.rb @@ -3,6 +3,12 @@ module WithPerformanceBar extend ActiveSupport::Concern + included do + before_action :peek_enabled? # Warm cache + end + + protected + def peek_enabled? return false unless Gitlab::PerformanceBar.enabled?(current_user) -- cgit v1.2.3