8000 CeleryIntegration with Redbeat scheduler seems to send 2 In Progress Check ins leading 1 to Timeout · Issue #4392 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content
CeleryIntegration with Redbeat scheduler seems to send 2 In Progress Check ins leading 1 to Timeout #4392
@Fwang36

Description

@Fwang36

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 -

@signals.beat_init.connect
@signals.celeryd_init.connect
def init_sentry(**_kwargs):
    sentry_sdk.init(
        dsn="<DSN>",
        send_default_pii=True,
        integrations=[CeleryIntegration(
            monitor_beat_tasks=True,
        )],
        debug=True,
    )

Run commands -

celery -A tasks worker --loglevel=INFO
celery -A tasks beat --scheduler redbeat.RedBeatScheduler --loglevel=INFO

When the task starts, I get 2 monitor check ins per every time the ta 8752 sk is run (task runs 2 times in screenshot) in beat terminal -

Image

In the worker terminal, I get 1 check in per task (as expected) -

Image

In the UI, it looks like this, where the In Progress check ins will then timeout after the set threshold -

Image

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.

Metadata

Metadata

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0