-
-
Notifications
You must be signed in to change notification settings - Fork 513
Suppress notifications on Sidekiq retries #1570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Since version |
Thanks for responding, @st0012. I should have clarified that I'm aware of By default, Sidekiq's exponential backoff starts every minute and goes on for ~20 days. If an exception happened over the weekend in a background job, by the time it was addressed on Monday, Sentry might have 15 errors tracked. But if So the sweet spot really seems to me "after the first instance, and only the first instance". Per Sidekiq's docs, this is inline with best practices (though I think 1st is far more valuable than 3rd/10th):
|
Before continuing the discussion, let's make sure we're on the same page. Are these the behaviors you expect?
|
If we're on the same page that this behavior is currently unsupported and would be valuable in the future, I think we're good to talk about expected behaviors. Your chart might be correct for my prior thinking, but I think seeing it laid out shows I wasn't thinking thoroughly enough, and I think that would be confusing for users. I think it's really three states: reporting after the first instance, reporting after every failure, and reporting after the last retry. So maybe it's one of these two strategies: Optimized for no new configAdd three new options to the existing
Optimized for future flexibility, taking on the cost of a deprecation:Introduce a new setting intended to replace
|
I think I like this solution the most. But this is actually the first time that I received such request (either in old SDK or the current one). So I'm not sure if the benefit of this change would worth the effort. For example:
I'd like to see some real world cases for this feature before committing into it, because we'll likely to support it for a long time. |
Thanks for taking the time to circle back on this, Stan.
We're often dealing with bulk actions that are still important to customers but too expensive for web requests or imports. So we want to get those failure notices as soon as possible.
I think this is the real question. We use sidekiq's default retry configuration, which does seem optimized for intermittent availability issues with third-party systems. But our most common failures are application code, and the occasional race condition where a job will succeed after a single failure. Perhaps we should consider being more judicious in our retry settings. From my end, I've monkeypatched Again, thanks for taking the time to go around on this one. Just turned off our competitor and moved over to a paid plan, but I'll likely have one more sentry-rails question coming your way. |
@jpcody - can you share your monkey patch code? |
Sure thing: https://gist.github.com./jpcody/dc6704c89d5b130d31dae849a6ccb62d |
Love the integrity checker. Thanks! |
@jpcody - imagine you have an error in your worker. It fails, the error gets sent to Sentry. You fix the issue, but then a different error happens on the retry. This error wouldn't get sent to Sentry. Probably low probability of this happening but just thinking of the edge cases. |
That's actually a great point, and I don't consider that low-probability. While I have never once written a class with two different bugs, I hear that other people have 😆 We are typically doing manual checks of the retry queue, so we would eventually catch this, but it'd sure be nice to be able to disregard the notification only if it was the same error coming from the same line number. If I can come up with a solution to this, I'll post it here. |
Sidekiq keeps data about the exception for the jobs in the |
Some users have also proposed concepts like |
In our case, I don't think this would take care of us, because it could be any number of exceptions. But we are currently set with the aforementioned monkeypatch, and I'm a-ok to let this lie and let someone else re-open it if it turns out to be a common issue. |
@jpcody I see. I'll close this for now then, thanks for the thoughtful suggestion 👍 |
Describe the idea
I'd love if Sidekiq could report only on the first retry.
Why do you think it's beneficial to most of the users
If retries are errors in application code or longer outages of third-party dependencies, capturing a series of the same errors isn't useful.
Possible implementation
A
config.sidekiq.report_on_retries
boolean configuration option could be checked inSentry::Sidekiq::ErrorHandler
. In that class, the.call
method could return ifconfig.sidekiq.report_on_retries
is false andretry_count
is present in the job context.The text was updated successfully, but these errors were encountered: