-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Feature/disable prefetch fixes #9863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
for more information, see https://pre-commit.ci
…pool size; add CLI --disable-prefetch test; ensure consumer tests pass
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9863 +/- ##
==========================================
+ Coverage 78.69% 78.70% +0.01%
==========================================
Files 153 153
Lines 19243 19257 +14
Branches 2557 2561 +4
==========================================
+ Hits 15143 15156 +13
Misses 3803 3803
- Partials 297 298 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Add dedicated tests for disable_prefetch flag handling in worker.py to improve test coverage. This addresses the coverage issue identified by Codecov in PR #9863.
should be covered well now |
Add comprehensive tests for the worker's disable_prefetch flag handling to improve test coverage. Refactored tests to be more concise, focused, and pass all lint checks. This addresses the coverage issue identified by Codecov in PR #9863.
Nusnus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note the integration tests are currently broken in main, preventing merges of non-trivial changes.
A fix is in progress 🙏
|
Thanks a lot for working on this! Any chances to get it merged in the nearest future? |
@Nusnus is CI fixed? |
Hopefully by (my) EOD today. |
auvipy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, do we have relevant issues open in kombu for the following note:
This is a pragmatic Celery‑side QoS guard. Longer‑term, the ideal place for this behavior would be in Kombu’s QoS, with Celery surfacing the option.
|
Needed |
Added Might even have a PR for this later today :) Side question: |
|
v5.6 |
|
we got a regression report of this. can you please check it? we might need to revert it for a while if needed #9913 |
|
May be you could leave it at least for redis? |
|
yes, that is possible |
Note: Before submitting this pull request, please review our contributing guidelines.
Description
Introduce an option to completely disable broker prefetching without requiring
acks_late. When enabled, the worker only fetches a new task when an execution slot is available. This prevents head‑of‑line blocking and starvation caused by long‑running tasks.What’s included
worker_disable_prefetch(default: False)--disable-prefetchchannel.qos.can_consumeto checkreserved_requestsagainst effective concurrency:max_concurrencyif present, otherwise pool size--disable-prefetchgetattr(c.controller, "max_concurrency", None) or c.pool.num_processesBackward compatibility
Implementation notes
Testing
References