Skip to content

fix(worker): treat 'merged' as final state in finisher idempotency check#771

Draft
drazisil-codecov wants to merge 1 commit intomainfrom
fix/finisher-idempotency-merged-state
Draft

fix(worker): treat 'merged' as final state in finisher idempotency check#771
drazisil-codecov wants to merge 1 commit intomainfrom
fix/finisher-idempotency-merged-state

Conversation

@drazisil-codecov
Copy link
Contributor

@drazisil-codecov drazisil-codecov commented Mar 16, 2026

After #766 changed successful uploads from processed to merged, the finisher's idempotency check still used ('processed', 'error') as terminal states. processed is now a dead state that will never be set again.

When a finisher was re-triggered (retries, visibility timeout, duplicate enqueue), it saw uploads in merged state, concluded they weren't finished, and ran finish_reports_processing again — enqueuing a duplicate save_commit_measurements task each time. This caused the timeseries queue to grow to 200K+ starting March 13th.

The fix drops processed from the check entirely and uses ('merged', 'error') as the only terminal states, matching the current upload lifecycle.

@sentry
Copy link
Contributor

sentry bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.27%. Comparing base (138b687) to head (559f613).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #771   +/-   ##
=======================================
  Coverage   92.27%   92.27%           
=======================================
  Files        1305     1305           
  Lines       47938    47938           
  Branches     1628     1628           
=======================================
  Hits        44233    44233           
  Misses       3396     3396           
  Partials      309      309           
Flag Coverage Δ
workerintegration 58.56% <ø> (ø)
workerunit 90.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

…isher idempotency check

The idempotency check used ('processed', 'error') as terminal upload
states. After #766 changed successful uploads to 'merged', 'processed'
became a dead state that will never be set again. Re-triggered finishers
saw uploads in 'merged' state, concluded they weren't finished, and ran
finish_reports_processing again — enqueuing duplicate
save_commit_measurements tasks and flooding the timeseries queue to 200K+.

Drop 'processed' from the check and use ('merged', 'error') only.

Co-Authored-By: Claude <noreply@anthropic.com>
@drazisil-codecov drazisil-codecov force-pushed the fix/finisher-idempotency-merged-state branch from 559f613 to e681079 Compare March 16, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant