Skip to content

Commit 723220e

Browse files
committed
fix(seer): Validate batch_size option before backfill processing
If batch_size is 0, the DB query returns empty and the task silently skips all projects without processing anything. Log an error and return early instead.
1 parent 94fbeb9 commit 723220e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/sentry/tasks/seer/backfill_supergroups_lightweight.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ def _backfill_org(
8181
"seer.supergroups_backfill_lightweight.max_failures_per_batch"
8282
)
8383

84+
if batch_size <= 0:
85+
logger.error(
86+
"supergroups_backfill_lightweight.invalid_batch_size",
87+
extra={"organization_id": organization_id, "batch_size": batch_size},
88+
)
89+
return
90+
8491
# Get the next project to process, starting from where we left off
8592
project = (
8693
Project.objects.filter(

0 commit comments

Comments
 (0)