File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ module Sentry
5050
5151 THREAD_LOCAL = :sentry_hub
5252
53+ MUTEX = Mutex . new
54+
5355 class << self
5456 # @!visibility private
5557 def exception_locals_tp
@@ -275,8 +277,10 @@ def close
275277
276278 @background_worker . shutdown
277279
278- @main_hub = nil
279- Thread . current . thread_variable_set ( THREAD_LOCAL , nil )
280+ MUTEX . synchronize do
281+ @main_hub = nil
282+ Thread . current . thread_variable_set ( THREAD_LOCAL , nil )
283+ end
280284 end
281285
282286 # Returns true if the SDK is initialized.
@@ -303,7 +307,7 @@ def csp_report_uri
303307 #
304308 # @return [Hub]
305309 def get_main_hub
306- @main_hub
310+ MUTEX . synchronize { @main_hub }
307311 end
308312
309313 # Takes an instance of Sentry::Breadcrumb and stores it to the current active scope.
Original file line number Diff line number Diff line change @@ -12,9 +12,6 @@ gem "sentry-rails", path: "../sentry-rails"
1212# loofah changed the required ruby version in a patch so we need to explicitly pin it
1313gem "loofah" , "2.20.0" if RUBY_VERSION . to_f < 2.5
1414
15- # For https://github.com/ruby/psych/issues/655
16- gem "psych" , "5.1.0"
17-
1815sidekiq_version = ENV [ "SIDEKIQ_VERSION" ]
1916sidekiq_version = "7.0" if sidekiq_version . nil?
2017sidekiq_version = Gem ::Version . new ( sidekiq_version )
You can’t perform that action at this time.
0 commit comments