Skip to content

Conversation

@drazisil-codecov
Copy link
Contributor

@drazisil-codecov drazisil-codecov commented Dec 1, 2025

  • Introduced LockManager for consistent lock handling across tasks.
  • Updated tasks (ManualTrigger, PreProcessUpload, UploadFinisher, etc.) to utilize LockManager for acquiring locks.
  • Added blocking timeout configuration to prevent indefinite waiting on locks.
  • Enhanced error handling with LockRetry for better retry logic on lock acquisition failures.
  • Removed redundant lock handling code .
  • Updated tests to reflect changes in lock management and ensure proper behavior under lock contention scenarios.
  • visibility_timeout is now adjustable based on if acks_late is true.
  • Migrated task logging for max retries exceeded to LockManager for central logging.

- Introduced LockManager for consistent lock handling across tasks.
- Updated tasks (ManualTrigger, PreProcessUpload, UploadFinisher, etc.) to utilize LockManager for acquiring locks.
- Added blocking timeout configuration to prevent indefinite waiting on locks.
- Enhanced error handling with LockRetry for better retry logic on lock acquisition failures.
- Removed redundant lock handling code and improved logging for lock operations.
- Updated tests to reflect changes in lock management and ensure proper behavior under lock contention scenarios.
@linear
Copy link

linear bot commented Dec 1, 2025

@codecov-eu
Copy link

codecov-eu bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 93.58974% with 5 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/worker/tasks/tests/utils.py 83.33% 2 Missing ⚠️
apps/worker/tasks/upload_finisher.py 87.50% 2 Missing ⚠️
apps/worker/tasks/preprocess_upload.py 90.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codecov-notifications
Copy link

codecov-notifications bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 93.58974% with 5 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/worker/tasks/tests/utils.py 83.33% 2 Missing ⚠️
apps/worker/tasks/upload_finisher.py 87.50% 2 Missing ⚠️
apps/worker/tasks/preprocess_upload.py 90.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@sentry
Copy link

sentry bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 93.58974% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.86%. Comparing base (b081221) to head (6ccd53d).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/worker/tasks/tests/utils.py 83.33% 2 Missing ⚠️
apps/worker/tasks/upload_finisher.py 87.50% 2 Missing ⚠️
apps/worker/tasks/preprocess_upload.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #589      +/-   ##
==========================================
- Coverage   93.86%   93.86%   -0.01%     
==========================================
  Files        1284     1284              
  Lines       46492    46512      +20     
  Branches     1522     1522              
==========================================
+ Hits        43642    43660      +18     
- Misses       2540     2542       +2     
  Partials      310      310              
Flag Coverage Δ
apiunit 96.55% <ø> (ø)
sharedintegration 38.79% <100.00%> (+0.03%) ⬆️
sharedunit 88.77% <100.00%> (+<0.01%) ⬆️
workerintegration 58.60% <50.70%> (-0.05%) ⬇️
workerunit 91.22% <92.95%> (+<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.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 1, 2025

CodSpeed Performance Report

Merging #589 will not alter performance

Comparing CCMRG-1907-migrate-task-locks-to-lock-manager (6ccd53d) with main (39fb6a9)1

Summary

✅ 9 untouched

Footnotes

  1. No successful run was found on main (b081221) during the generation of this report, so 39fb6a9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

- Removed redundant comments regarding indefinite blocking timeout in multiple task files.
- Updated documentation in the `ensure_hard_time_limit_task_is_numeric` helper to clarify its usage in tests.
- Ensured consistency across tasks by standardizing the blocking timeout parameter handling.
- Eliminated unnecessary warning logs for lock acquisition failures in ManualTriggerTask, PreProcessUpload, UploadFinisherTask, and UploadTask.
- Streamlined error handling by focusing on essential logging, improving code clarity and reducing log noise.
- Updated the `locked` method in `LockManager` to accept an optional `max_retries` parameter for better control over retry logic.
- Adjusted task implementations (ManualTriggerTask, PreProcessUpload, UploadFinisherTask, UploadTask) to utilize the new `max_retries` parameter, improving error handling and logging consistency.
- Removed redundant lock acquisition logging from tasks, streamlining the code and reducing log noise.
- Removed redundant comments in `LockManager` and `UploadTask` to enhance code clarity.
- Updated `celery_config.py` to introduce configurable visibility timeouts for Redis broker based on task acknowledgment settings, improving task recovery and preventing duplicate executions.
- Adjusted unit tests to reflect changes in visibility timeout configuration, ensuring accurate assertions.
@drazisil-codecov drazisil-codecov marked this pull request as ready for review December 1, 2025 15:38
@calvin-codecov
Copy link
Contributor

It's failing on the 3 TestGetLockTimeout tests at the moment

@drazisil-codecov drazisil-codecov added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main with commit 7383d2c Dec 2, 2025
56 checks passed
@drazisil-codecov drazisil-codecov deleted the CCMRG-1907-migrate-task-locks-to-lock-manager branch December 2, 2025 18:00
@drazisil-codecov drazisil-codecov changed the title Refactor lock management in tasks to use LockManager CCMRG-1907 Refactor lock management in tasks to use LockManager Dec 2, 2025
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.

3 participants