This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2014年04月27日 11:39 by Claudiu.Popa, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| futures_max_workers.patch | Claudiu.Popa, 2014年04月27日 11:39 | review | ||
| issue21362.patch | Claudiu.Popa, 2014年04月27日 16:30 | review | ||
| issue21362_1.patch | Claudiu.Popa, 2014年04月27日 17:00 | Fix typo, don't duplicate the test. | review | |
| Messages (7) | |||
|---|---|---|---|
| msg217258 - (view) | Author: PCManticore (Claudiu.Popa) * (Python triager) | Date: 2014年04月27日 11:39 | |
Due to some bad math on my side, I passed max_workers=0 to concurrent.futures.ThreadPoolExecutor. This didn't fail properly, but hanged. The same behaviour occurs in ProcessPoolExecutor, but this time it fails internally with something like this: Exception in thread Thread-1: Traceback (most recent call last): File "C:\Python34\lib\threading.py", line 921, in _bootstrap_inner self.run() File "C:\Python34\lib\threading.py", line 869, in run self._target(*self._args, **self._kwargs) File "C:\Python34\lib\concurrent\futures\process.py", line 225, in _queue_management_worker assert sentinels AssertionError The attached patch checks that *max_workers* is <= 0 and raises ValueError if so. |
|||
| msg217259 - (view) | Author: PCManticore (Claudiu.Popa) * (Python triager) | Date: 2014年04月27日 11:41 | |
For instance, multiprocessing behaves like this: >>> multiprocessing.Pool(-1) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python34\lib\multiprocessing\context.py", line 118, in Pool context=self.get_context()) File "C:\Python34\lib\multiprocessing\pool.py", line 157, in __init__ raise ValueError("Number of processes must be at least 1") ValueError: Number of processes must be at least 1 >>> |
|||
| msg217280 - (view) | Author: PCManticore (Claudiu.Popa) * (Python triager) | Date: 2014年04月27日 16:30 | |
Attached patch with improvements suggested by Charles-François Natali. Thank you for the review. |
|||
| msg217376 - (view) | Author: Jim Jewett (Jim.Jewett) * (Python triager) | Date: 2014年04月28日 15:01 | |
I confirm the bug. The patch looks good. |
|||
| msg217532 - (view) | Author: Brian Quinlan (bquinlan) * (Python committer) | Date: 2014年04月29日 17:50 | |
The patch looks good to me too. I'll commit it soon. |
|||
| msg218714 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年05月17日 20:52 | |
New changeset 3024ad49f00e by Brian Quinlan in branch 'default': Issue #21362: concurrent.futures does not validate that max_workers is proper http://hg.python.org/cpython/rev/3024ad49f00e |
|||
| msg218715 - (view) | Author: Brian Quinlan (bquinlan) * (Python committer) | Date: 2014年05月17日 20:53 | |
Committed, thanks for the fix! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:02 | admin | set | github: 65561 |
| 2014年05月17日 20:53:32 | bquinlan | set | status: open -> closed resolution: fixed messages: + msg218715 |
| 2014年05月17日 20:52:35 | python-dev | set | nosy:
+ python-dev messages: + msg218714 |
| 2014年04月29日 17:50:38 | bquinlan | set | assignee: bquinlan messages: + msg217532 |
| 2014年04月28日 15:01:51 | Jim.Jewett | set | nosy:
+ Jim.Jewett messages: + msg217376 |
| 2014年04月27日 19:30:49 | neologix | set | stage: patch review -> commit review |
| 2014年04月27日 17:00:21 | Claudiu.Popa | set | files: + issue21362_1.patch |
| 2014年04月27日 16:57:10 | flox | set | nosy:
+ flox stage: patch review versions: + Python 3.4 |
| 2014年04月27日 16:30:17 | Claudiu.Popa | set | files:
+ issue21362.patch messages: + msg217280 |
| 2014年04月27日 11:41:04 | Claudiu.Popa | set | messages: + msg217259 |
| 2014年04月27日 11:39:29 | Claudiu.Popa | create | |