Commit 2f97cda
authored
fix(celery): Do not send extra check-in (#4395)
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 #43921 parent aa0eaab commit 2f97cda
File tree
3 files changed
+14
-12
lines changed- sentry_sdk/integrations/celery
- tests/integrations/celery
3 files changed
+14
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
485 | | - | |
| 484 | + | |
| 485 | + | |
486 | 486 | | |
487 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
488 | 490 | | |
489 | 491 | | |
490 | 492 | | |
491 | | - | |
| 493 | + | |
492 | 494 | | |
493 | 495 | | |
494 | 496 | | |
495 | 497 | | |
496 | | - | |
| 498 | + | |
497 | 499 | | |
0 commit comments