New submission from Petr Zemek:

multiprocessing.Pool.__exit__() calls terminate() instead of close(). Why? 
Wouldn't it be better (and more expected from a user's point of view) if it 
called close()?

Reasons:

- Calling close() would wait until all tasks are completed before shutting down 
the pool instead of terminating them abruptly when some of them may still be 
running.

- concurrent.futures.ProcessPoolExecutor.__exit__() calls shutdown(wait=True), 
which waits until all tasks are finished. In this regard, the behavior of 
Pool.__exit__() is inconsistent.

See also this comment by Dan O'Reilly (http://bugs.python.org/msg242120), who 
expressed an identical concern two years ago.

----------
components: Library (Lib)
messages: 290923
nosy: s3rvac
priority: normal
severity: normal
status: open
title: multiprocessing.Pool.__exit__() calls terminate() instead of close()
type: behavior
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29954>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to