-
Notifications
You must be signed in to change notification settings - Fork 545
CeleryIntegration with Redbeat scheduler seems to send 2 In Progress Check ins leading 1 to Timeout #4392
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
Hey @Fwang36 thanks for the great issue description! I will have a look |
I have now reproduced your error:
That is the project I used: https://github.com/antonpirker/testing-sentry/tree/main/test-celery-redbeat So clearly something is off. I prioritize this fix. I'll keep you posted, sometime next we should have this fixed. |
I have now tested by disabling |
This looks like possible double instrumentation to me. Is it possible you're using both |
Nevermind, I get the extra |
As far as I can tell, the problem is that we're patching redbeat's |
Small related docs update: getsentry/sentry-docs#13751 |
When using the RedBeatScheduler, we're sending an extra in-progress check-in at scheduler start. Since this is never followed by an ok or error check-in, the check-in is marked as timed out in Sentry. We're patching the scheduler's `maybe_due`, which (as the name implies) [might not end up executing the task](https://github.com/sibson/redbeat/blob/bdefad23b47f75e2e85d45f46f9f16dd00a93d40/redbeat/schedulers.py#L506-L508). This is indeed what seems to be happening -- `maybe_due` is run when the scheduler starts, but without scheduling the task. We don't check whether `maybe_due` actually ended up scheduling anything and always fire an in-progress check-in. Patching the [scheduler's `apply_async`](https://github.com/sibson/redbeat/blob/bdefad23b47f75e2e85d45f46f9f16dd00a93d40/redbeat/schedulers.py#L511) instead. Closes #4392
The fix for this is now out in 2.29.0! |
Uh oh!
There was an error while loading. Please reload this page.
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.28.0
Steps to Reproduce
Helping a user in this Zendesk ticket (last several responses): https://sentry.zendesk.com/agent/tickets/152175
It seems like the celery integration used with the Redbeat scheduler is creating two in-progress check in events at the scheduled time. The worker only sends 1 OK check-in event leading to the other in-progress event to timeout. I was able to reproduce this with a task that runs every minute.
Using the celery beat scheduler instead of redbeat works as expected.
My sentry settings -
Run commands -
When the task starts, I get 2 monitor check ins per every time the task is run (task runs 2 times in screenshot) in beat terminal -
In the worker terminal, I get 1 check in per task (as expected) -
In the UI, it looks like this, where the In Progress check ins will then timeout after the set threshold -
Link to my monitor
Expected Result
Sends only 1 in progress event when the task begins.
Expect behavior to match celery beat scheduler
Actual Result
Sends 2 in progress events when the task begins.
The text was updated successfully, but these errors were encountered: