[New-bugs-announce] [issue39458] Multiprocessing.Pool maxtasksperchild=1 doesn't work

Gabriel Tardif report at bugs.python.org
Sun Jan 26 17:30:15 EST 2020


New submission from Gabriel Tardif <gabriel at zeroinfo.tech>:

Hello

This bug is about the maxtasksperchild parameter in the Pool object constructor of the multiprocessing module.

When you set processes = 1 in the Pool constructor
maxtasksperchild value is double by two for unknow raison whatever the maxtaskperchild value.

As mentionned in the documentation, once the process has reach the maxtasksperchil value it should rebuild itself in the memory from the parent process.

In the short python exemple provided below, you can see the value of showedFiles of each process incresing over 1 which is not normal if Pool constructor is set to processes = 1, maxtasksperchil = 1.

The only running process should destroy / reset itself and so set its value 'showedFiles' to 0 first and 1 for each os.listdir() entry.

----------
assignee: docs at python
components: Documentation
files: reader.py
messages: 360736
nosy: Gabriel Tardif, docs at python
priority: normal
severity: normal
status: open
title: Multiprocessing.Pool maxtasksperchild=1 doesn't work
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48864/reader.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39458>
_______________________________________


More information about the New-bugs-announce mailing list