Skip to content

Conversation

@drazisil-codecov
Copy link
Contributor

@drazisil-codecov drazisil-codecov commented Jan 23, 2026

Problem

PR #668 removed the lock name from the LockRetry error message but left Repo: {repoid}, Commit: {commitid} in the message. Since each repo/commit combination is unique, Sentry was still creating separate issues for each occurrence instead of grouping them together.

Evidence from production (release production-release-482156a):

  • WORKER-WYP - "Lock acquisition failed after 11 retries (max: 11). Repo: 21784895, Commit: a45b..."
  • WORKER-WYN - "Lock acquisition failed after 11 retries (max: 11). Repo: 7098251, Commit: bb05..."

Solution

Remove repo and commit from the error message string entirely. The message is now just:

Lock acquisition failed after 11 retries (max: 11).

All identifying information remains available in:

  • Exception attributes (exc.lock_name, exc.repoid, exc.commitid)
  • Sentry context (lock_acquisition context with full details)
  • Sentry tags (lock_name, lock_type)

Test Plan

  • Existing tests pass (27 tests in test_lock_manager.py)
  • Monitor Sentry to confirm new errors are properly grouped under a single issue

Fixes CCMRG-2031


Note

Makes LockRetry exception message generic to improve Sentry issue grouping while preserving identifiers in attributes and Sentry context/tags.

  • Updates LockRetry.__init__ to remove repoid/commitid from the max-retries error message; adds comment explaining grouping rationale
  • No changes to lock acquisition logic, retries, backoff, or Sentry logging/capture apart from the message text

Written by Cursor Bugbot for commit cfcc482. This will update automatically on new commits. Configure here.

@linear
Copy link

linear bot commented Jan 23, 2026

@drazisil-codecov drazisil-codecov force-pushed the joebecher/ccmrg-2031-fix-lock-retry-sentry-grouping branch from 29ebe4c to 6efbff0 Compare January 23, 2026 15:06
…try grouping

The previous fix (PR #668) removed the lock name but left repo and commit
in the error message. Since each repo/commit combination is unique, Sentry
was still creating separate issues for each occurrence.

Now the message is generic - all identifying info remains available in:
- Exception attributes (lock_name, repoid, commitid)
- Sentry context (lock_acquisition)
- Sentry tags (lock_name, lock_type)

Fixes CCMRG-2031
@drazisil-codecov drazisil-codecov force-pushed the joebecher/ccmrg-2031-fix-lock-retry-sentry-grouping branch from 6efbff0 to cfcc482 Compare January 23, 2026 15:09
@sentry
Copy link

sentry bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.53%. Comparing base (482156a) to head (cfcc482).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #673      +/-   ##
==========================================
- Coverage   92.53%   92.53%   -0.01%     
==========================================
  Files        1295     1295              
  Lines       47678    47677       -1     
  Branches     1592     1592              
==========================================
- Hits        44121    44120       -1     
  Misses       3248     3248              
  Partials      309      309              
Flag Coverage Δ
workerintegration 58.48% <100.00%> (-0.01%) ⬇️
workerunit 90.14% <100.00%> (-0.01%) ⬇️

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!

@drazisil-codecov drazisil-codecov requested a review from a team January 23, 2026 15:49
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.

2 participants