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.

Author jeyekomon
Recipients jeyekomon
Date 2020-01-28.13:04:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580216696.5.0.546840504905.issue39477@roundup.psfhosted.org>
In-reply-to
Content
The following code is expected to fail:


import multiprocessing

def f(x):
	return x

if __name__ == '__main__':
	with multiprocessing.Pool(2, maxtasksperchild=0) as pool:
		pool.map(f, range(3))


since it uses a wrong value of the 'maxtasksperchild' parameter. I expect it to raise a ValueError but instead it starts to fill the stderr with practically endless traceback:


Process ForkPoolWorker-2:
Process ForkPoolWorker-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 95, in worker
    assert maxtasks is None or (type(maxtasks) == int and maxtasks > 0)
Traceback (most recent call last):
AssertionError
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 95, in worker
    assert maxtasks is None or (type(maxtasks) == int and maxtasks > 0)
AssertionError
Process ForkPoolWorker-4:
Process ForkPoolWorker-3:
...


I don't think this is expected behavior.
Tested with Python 3.6.9 on Ubuntu 18.04.3.
History
Date User Action Args
2020-01-28 13:04:56jeyekomonsetrecipients: + jeyekomon
2020-01-28 13:04:56jeyekomonsetmessageid: <1580216696.5.0.546840504905.issue39477@roundup.psfhosted.org>
2020-01-28 13:04:56jeyekomonlinkissue39477 messages
2020-01-28 13:04:56jeyekomoncreate