Skip to content

Commit

Permalink
Update sentry-sidekiq for Sidekiq 7.1.5
Browse files Browse the repository at this point in the history
In sidekiq/sidekiq#6051, Sidekiq changed the
expected parameters on the error handler. However, because it assumes
error handler to be a Proc, it uses `#arity` for checking the number of
parameters. This is not compatible with our error handler, which is a
class.
  • Loading branch information
st0012 committed Oct 5, 2023
1 parent 58253af commit 9f65ffc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion sentry-sidekiq/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ gem "rexml"
gem "loofah", "2.20.0" if RUBY_VERSION.to_f < 2.5

sidekiq_version = ENV["SIDEKIQ_VERSION"]
sidekiq_version = "6.0" if sidekiq_version.nil?
sidekiq_version = "7.0" if sidekiq_version.nil?

gem "sidekiq", "~> #{sidekiq_version}"
gem "rails"

gem "ruby-lsp-rspec"

if RUBY_VERSION.to_f >= 2.6
gem "debug", github: "ruby/debug", platform: :ruby
gem "irb"
Expand Down
4 changes: 4 additions & 0 deletions sentry-sidekiq/lib/sentry/sidekiq/error_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def call(ex, context)
scope&.clear
end

def arity
method(:call).arity
end

private

def retryable?(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@

q = queue.to_a
expect(q.size).to be(2)
first_headers = q.first["trace_propagation_headers"]
first_headers = q[0]["trace_propagation_headers"]
expect(first_headers["sentry-trace"]).to eq(transaction.to_sentry_trace)
expect(first_headers["baggage"]).to eq(transaction.to_baggage)

second_headers = q.second["trace_propagation_headers"]
second_headers = q[1]["trace_propagation_headers"]
expect(second_headers["sentry-trace"]).to eq(transaction.to_sentry_trace)
expect(second_headers["baggage"]).to eq(transaction.to_baggage)
end
Expand Down

0 comments on commit 9f65ffc

Please sign in to comment.