[issue37507] multiprocessing: Add a stop() method to ForkServer

STINNER Victor report at bugs.python.org
Mon Jul 8 04:20:36 EDT 2019


STINNER Victor <vstinner at redhat.com> added the comment:

> There is no reason to expose "stop the forkserver" to users. How the forkserver process works, what tasks it handles, is an implementation detail. If users start "stopping the forkserver" in their applications for no good to reason, they might get bugs now or later that they wouldn't get otherwise.

Well, we already had this conversation before. I really dislike APIs which hold resources but disallow to "release resources", especially when a resource is not a few bytes of memory, but a whole process.

Since there is a method to start the server (ensure_running), I would like to control when it's stopped "to ensure that errors are properly reported if something goes wrong."

That's why I added Process.close() in Python 3.7 and ResourceWarning in Pool in Python 3.8.

Here I don't propose to add a ResourceWarning if the server is not stopped explicitly. I only propose to add a method if the developer wants to control when it's stopped.

----------

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


More information about the Python-bugs-list mailing list