Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions sentry-ruby/lib/sentry-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ module Sentry

THREAD_LOCAL = :sentry_hub

MUTEX = Mutex.new

class << self
# @!visibility private
def exception_locals_tp
Expand Down Expand Up @@ -275,8 +277,10 @@ def close

@background_worker.shutdown

@main_hub = nil
Thread.current.thread_variable_set(THREAD_LOCAL, nil)
MUTEX.synchronize do
@main_hub = nil
Thread.current.thread_variable_set(THREAD_LOCAL, nil)
end
end

# Returns true if the SDK is initialized.
Expand All @@ -303,7 +307,7 @@ def csp_report_uri
#
# @return [Hub]
def get_main_hub
@main_hub
MUTEX.synchronize { @main_hub }
end

# Takes an instance of Sentry::Breadcrumb and stores it to the current active scope.
Expand Down
3 changes: 0 additions & 3 deletions sentry-sidekiq/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ gem "sentry-rails", path: "../sentry-rails"
# loofah changed the required ruby version in a patch so we need to explicitly pin it
gem "loofah", "2.20.0" if RUBY_VERSION.to_f < 2.5

# For https://github.com/ruby/psych/issues/655
gem "psych", "5.1.0"

sidekiq_version = ENV["SIDEKIQ_VERSION"]
sidekiq_version = "7.0" if sidekiq_version.nil?
sidekiq_version = Gem::Version.new(sidekiq_version)
Expand Down
Loading