-
Notifications
You must be signed in to change notification settings - Fork 296
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
Retry perform_notification
with Telegram ratelimit countdown on RetryAfter
error
#3744
Conversation
TelegramToUserConnector.notify_user(user, alert_group, notification_policy) | ||
except RetryAfter as e: | ||
countdown = getattr(e, "retry_after", 3) | ||
perform_notification.retry((log_record_pk,), countdown=countdown, exc=e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I think retry
will raise an exception (besides queuing a new task), and since we have the autoretry_for
set for Exception
, you will end having 2 new tasks from this (the retry because of the exception, and the task added by the retry call). See here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, thanks for the information 👍 I wasn't able to reproduce it locally though, I can see only one retrying task, but it probably makes sense to change the call to apply_async
here just in case 🤔
UPD: or use dont_autoretry_for=(Retry,)
…tryAfter` error (#3744) # What this PR does Use Telegram ratelimit countdown when retry `perform_notification` task on `RetryAfter` error ## Which issue(s) this PR fixes grafana/oncall-private#2451 ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required)
What this PR does
Use Telegram ratelimit countdown when retry
perform_notification
task onRetryAfter
errorWhich issue(s) this PR fixes
https://github.com/grafana/oncall-private/issues/2451
Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)