Skip to content

Sidekiq error handler only compatible with Sidekiq >= 7.1.5 #183

@maknz

Description

@maknz

Since upgrading to 4.0.0, when an error is raised in a Sidekiq job, we get the following exception:

queue-1       | 2024-05-29T03:08:18.533Z pid=1 tid=d3p ERROR: !!! ERROR HANDLER THREW AN ERROR !!!
queue-1       | 2024-05-29T03:08:18.539Z pid=1 tid=d3p ERROR: wrong number of arguments (given 2, expected 3)
queue-1       | 2024-05-29T03:08:18.539Z pid=1 tid=d3p ERROR: /usr/local/bundle/gems/raygun4ruby-4.0.0/lib/raygun/sidekiq.rb:9:in `call'
queue-1       | /usr/local/bundle/gems/sidekiq-7.1.4/lib/sidekiq/config.rb:269:in `block in handle_exception'
queue-1       | /usr/local/bundle/gems/sidekiq-7.1.4/lib/sidekiq/config.rb:268:in `each'
queue-1       | /usr/local/bundle/gems/sidekiq-7.1.4/lib/sidekiq/config.rb:268:in `handle_exception'

The error relates to the config argument being added to the error handler in 4.0.0, a feature apparently introduced in Sidekiq 7.1.5 (https://github.com/sidekiq/sidekiq/blob/main/Changes.md#715) and error handlers will need to support it by Sidekiq 8.

The Sidekiq change logs makes it sound like the change is backwards compatible, but I believe in the sense that old error handlers that didn't expect config would not be passed it, not that handlers could add this extra argument and have it work with older Sidekiq.

We fixed this by upgrading to Sidekiq 7.2.4 from Sidekiq 7.1.4, but I suspect introducing a breaking change here wasn't intentional.

Cheers!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions