Giter Site home page Giter Site logo

Comments (10)

dgsangoma avatar dgsangoma commented on June 10, 2024 1

I'll work on putting together a minimal setup that is able to reproduce the issue.

from airbrake.

kyrylo avatar kyrylo commented on June 10, 2024

We read max_retries from Sidekiq class directly. If that's not configured, we use Sidekiq::JobRetry::DEFAULT_MAX_RETRY_ATTEMPTS:

@max_retries ||= ::Sidekiq.options[:max_retries] || DEFAULT_MAX_RETRY_ATTEMPTS

It's quite possible that we don't take into account sidekiq_options retry: 60.
Thanks for the report!

from airbrake.

kyrylo avatar kyrylo commented on June 10, 2024

It's quite possible that we don't take into account sidekiq_options retry: 60.

I couldn't confirm this. In your sample params, I can see the correct retry value ("retry": 3,). After reading the code and testing, I can see that we do respect the per-job retry option.

elsif job['retry'].is_a?(Integer)
job['retry']

I used the following code to test:

require 'sidekiq'
require 'airbrake'

::Sidekiq.options[:max_retries] = 1

Airbrake.configure do |c|
  c.project_id = 1
  c.project_key = 'asd'
  c.logger = Logger.new(STDOUT)
  c.performance_stats = false
  c.remote_config = false
end

Airbrake.add_filter(Airbrake::Sidekiq::RetryableJobsFilter.new)

class TestWorker
  include Sidekiq::Job
  sidekiq_options retry: 3
  sidekiq_retry_in do |count|
    5
  end

  def perform(name)
    p "Hey #{name}"
    raise
  end
end

TestWorker.perform_async('Joe')

Could you please provide a demo worker that demonstrates the problem that you mentioned?

from airbrake.

kyrylo avatar kyrylo commented on June 10, 2024

Gentle ping @dgsangoma.

from airbrake.

dgsangoma avatar dgsangoma commented on June 10, 2024

I've made a small test app to try to reproduce the issue, but am struggling to reliably reproduce the issue in the test app.

from airbrake.

kyrylo avatar kyrylo commented on June 10, 2024

Thanks! Could share the app and the instructions on how to run it? I can clone it and run it multiple times to see how it fails.

from airbrake.

dgsangoma avatar dgsangoma commented on June 10, 2024

I should clarify that I'm not sure I've managed to reproduce the issue yet in a small test Rails app, so there's some key detail about our production app that's missing from the test app that's required to reproduce the bug. I can confirm we're still seeing it intermittently in production on airbrake 13.0.3 / airbrake-ruby 6.2.0. I'll need to keep trying things to see if I can uncover what's missing that's required unless you have any suggestions for getting more insightful info out of our production app.

from airbrake.

kyrylo avatar kyrylo commented on June 10, 2024

I don't really have any debugging tips for you. By manual code inspection, it should work, but I am not a Sidekiq user, and I don't have a profound knowledge of it. Maybe you defined some sort of Sidekiq config that alters the behavior.

If you take a look at the example I shared above, does it look the same as your workers?

from airbrake.

dgsangoma avatar dgsangoma commented on June 10, 2024

My worker is part of a large Rails app as opposed to a single file standalone worker like the example above. Global sidekiq configuration is managed in our app via a yml config file. We have require "airbrake/sidekiq" at the top of our Airbrake initializer. We've defined the sidekiq_retries_exhausted callback to do additional failure handling on the final retry. I'm sure there's other differences that are less obvious.

I guess I'll continue to experiment and maybe eventually I'll stumble onto the bug.

from airbrake.

kyrylo avatar kyrylo commented on June 10, 2024

Thanks for the update. Maybe sidekiq_retries_exhausted is the clue. For now, I am going to close this issue because I cannot take any action here without a reproducible example, but please do ping me in case the situation changes 🙏

from airbrake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.