-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix '--pool=threads' support in command line options parsing #6787
Fix '--pool=threads' support in command line options parsing #6787
Conversation
This pull request introduces 1 alert when merging f8c81bb into c93371d - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #6787 +/- ##
==========================================
+ Coverage 70.63% 70.69% +0.05%
==========================================
Files 138 138
Lines 16594 16597 +3
Branches 2089 2090 +1
==========================================
+ Hits 11722 11733 +11
+ Misses 4677 4668 -9
- Partials 195 196 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@thedrow Shall I fix the failing codecov checks? |
It would be great |
@auvipy Ok, I added 2 unit tests, covering cases of missing and existing |
This pull request introduces 1 alert when merging 8e77e31 into c93371d - view on LGTM.com new alerts:
|
@stack-overflow @auvipy I checkout your commit and used -P threads in command but it still failed, please check: Messages: Error: Invalid value for '-P' / '--pool': invalid choice: threads. (choose from prefork, eventlet, gevent, solo) |
@meocong thanks for reporting this. What Python version you use? Threads option dependens on |
@stack-overflow I use Python 3.7, -P threads is good and I want to have it back soon :D |
Signed-off-by: tdruez <tdruez@nexb.com>
could you both recheck again? |
* Fix '--pool=threads' support in command line options parsing * Add unit tests for concurrency.get_available_pool_names
…6787) * Fix '--pool=threads' support in command line options parsing * Add unit tests for concurrency.get_available_pool_names
Description
This PR fixes
celery worker
behaviour when parsing--pool=threads
argument, and a related issue in command line--pool
argument parsing.First issue
The
threads
pool type is not recognised in command line args parsing. It's missing from the list of possible options, even though it's supported by Celery since 4.4.Minimal example of the issue:
Run
celery worker --pool=threads
This is the output:
Second issue
When you specify any argument that is not specified in the
ALIASES
dict incelery/concurrency/__init__.py
, you get an error. It happens, because the functionmaybe_patch_concurrency
tries to get pool implementation before actually validating the command line arguments.Minimal example:
Run
celery worker --pool=xxx
This is the output:
I fixed that issue and now it outputs the proper error message: