<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Lib/concurrent/futures/process.py, branch enum-private-310</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/'/>
<entry>
<title>bpo-40692: Run more test_concurrent_futures tests (GH-20239)</title>
<updated>2021-02-08T03:15:51+00:00</updated>
<author>
<name>Asheesh Laroia</name>
<email>github@asheesh.org</email>
</author>
<published>2021-02-08T03:15:51+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=bf2e7e55d7306b1e2fce7dce767e8df5ff42cf1c'/>
<id>bf2e7e55d7306b1e2fce7dce767e8df5ff42cf1c</id>
<content type='text'>
In the case of multiprocessing.synchronize() being missing, the
test_concurrent_futures test suite now skips only the tests that
require multiprocessing.synchronize().

Validate that multiprocessing.synchronize exists as part of
_check_system_limits(), allowing ProcessPoolExecutor to raise
NotImplementedError during __init__, rather than crashing with
ImportError during __init__ when creating a lock imported from
multiprocessing.synchronize.

Use _check_system_limits() to disable tests of
ProcessPoolExecutor on systems without multiprocessing.synchronize.

Running the test suite without multiprocessing.synchronize reveals
that Lib/compileall.py crashes when it uses a ProcessPoolExecutor.
Therefore, change Lib/compileall.py to call _check_system_limits()
before creating the ProcessPoolExecutor.

Note that both Lib/compileall.py and Lib/test/test_compileall.py
were attempting to sanity-check ProcessPoolExecutor by expecting
ImportError. In multiprocessing.resource_tracker, sem_unlink() is also absent
on platforms where POSIX semaphores aren't available. Avoid using
sem_unlink() if it, too, does not exist.

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the case of multiprocessing.synchronize() being missing, the
test_concurrent_futures test suite now skips only the tests that
require multiprocessing.synchronize().

Validate that multiprocessing.synchronize exists as part of
_check_system_limits(), allowing ProcessPoolExecutor to raise
NotImplementedError during __init__, rather than crashing with
ImportError during __init__ when creating a lock imported from
multiprocessing.synchronize.

Use _check_system_limits() to disable tests of
ProcessPoolExecutor on systems without multiprocessing.synchronize.

Running the test suite without multiprocessing.synchronize reveals
that Lib/compileall.py crashes when it uses a ProcessPoolExecutor.
Therefore, change Lib/compileall.py to call _check_system_limits()
before creating the ProcessPoolExecutor.

Note that both Lib/compileall.py and Lib/test/test_compileall.py
were attempting to sanity-check ProcessPoolExecutor by expecting
ImportError. In multiprocessing.resource_tracker, sem_unlink() is also absent
on platforms where POSIX semaphores aren't available. Avoid using
sem_unlink() if it, too, does not exist.

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-40443: Remove unused imports in the stdlib (GH-19803)</title>
<updated>2020-04-30T09:26:33+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-04-30T09:26:33+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=90549676e063c2c818cfc14213d3adb7edcc2bd5'/>
<id>90549676e063c2c818cfc14213d3adb7edcc2bd5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-39995: Fix concurrent.futures _ThreadWakeup (GH-19760)</title>
<updated>2020-04-29T01:32:06+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-04-29T01:32:06+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=a4dfe8ede5a37576e17035dccfe109ba7752237e'/>
<id>a4dfe8ede5a37576e17035dccfe109ba7752237e</id>
<content type='text'>
Fix a race condition in concurrent.futures._ThreadWakeup: access to
_ThreadWakeup is now protected with the shutdown lock.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a race condition in concurrent.futures._ThreadWakeup: access to
_ThreadWakeup is now protected with the shutdown lock.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-30966: concurrent.futures.Process.shutdown() closes queue (GH-19738)</title>
<updated>2020-04-27T18:53:37+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-04-27T18:53:37+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=1a275013d1ecc2e3778d64fda86174b2f13d6969'/>
<id>1a275013d1ecc2e3778d64fda86174b2f13d6969</id>
<content type='text'>
Process.shutdown(wait=True) of concurrent.futures now closes
explicitly the result queue.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Process.shutdown(wait=True) of concurrent.futures now closes
explicitly the result queue.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-39207: Spawn workers on demand in ProcessPoolExecutor (GH-19453)</title>
<updated>2020-04-19T14:00:59+00:00</updated>
<author>
<name>Kyle Stanley</name>
<email>aeros167@gmail.com</email>
</author>
<published>2020-04-19T14:00:59+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=1ac6e379297cc1cf8acf6c1b011fccc7b3da2cbe'/>
<id>1ac6e379297cc1cf8acf6c1b011fccc7b3da2cbe</id>
<content type='text'>
Roughly based on https://github.com/python/cpython/commit/904e34d4e6b6007986dcc585d5c553ee8ae06f95, but with a few substantial differences.

/cc @pitrou @brianquinlan</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Roughly based on https://github.com/python/cpython/commit/904e34d4e6b6007986dcc585d5c553ee8ae06f95, but with a few substantial differences.

/cc @pitrou @brianquinlan</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-39812: Remove daemon threads in concurrent.futures (GH-19149)</title>
<updated>2020-03-27T19:31:22+00:00</updated>
<author>
<name>Kyle Stanley</name>
<email>aeros167@gmail.com</email>
</author>
<published>2020-03-27T19:31:22+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=b61b818d916942aad1f8f3e33181801c4a1ed14b'/>
<id>b61b818d916942aad1f8f3e33181801c4a1ed14b</id>
<content type='text'>
Remove daemon threads from :mod:`concurrent.futures` by adding
an internal `threading._register_atexit()`, which calls registered functions
prior to joining all non-daemon threads. This allows for compatibility
with subinterpreters, which don't support daemon threads.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove daemon threads from :mod:`concurrent.futures` by adding
an internal `threading._register_atexit()`, which calls registered functions
prior to joining all non-daemon threads. This allows for compatibility
with subinterpreters, which don't support daemon threads.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-39678: refactor queue manager thread (GH-18551)</title>
<updated>2020-03-01T20:49:14+00:00</updated>
<author>
<name>Thomas Moreau</name>
<email>thomas.moreau.2010@gmail.com</email>
</author>
<published>2020-03-01T20:49:14+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=0e89076247580ba0e570c4816f0e5628a7e36e83'/>
<id>0e89076247580ba0e570c4816f0e5628a7e36e83</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-39104: Fix hanging ProcessPoolExecutor on shutdown nowait with pickling failure (GH-17670)</title>
<updated>2020-02-16T18:09:26+00:00</updated>
<author>
<name>Thomas Moreau</name>
<email>thomas.moreau.2010@gmail.com</email>
</author>
<published>2020-02-16T18:09:26+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=a5cbab552d294d99fde864306632d7e511a75d3c'/>
<id>a5cbab552d294d99fde864306632d7e511a75d3c</id>
<content type='text'>
As reported initially by @rad-pat in #6084, the following script causes a deadlock.

```
from concurrent.futures import ProcessPoolExecutor


class ObjectWithPickleError():
    """Triggers a RuntimeError when sending job to the workers"""

    def __reduce__(self):
        raise RuntimeError()


if __name__ == "__main__":
    e = ProcessPoolExecutor()
    f = e.submit(id, ObjectWithPickleError())
    e.shutdown(wait=False)
    f.result()  # Deadlock on get
```

This is caused by the fact that the main process is closing communication channels that might be necessary to the `queue_management_thread` later. To avoid this, this PR let the `queue_management_thread` manage all the closing.



https://bugs.python.org/issue39104



Automerge-Triggered-By: @pitrou</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As reported initially by @rad-pat in #6084, the following script causes a deadlock.

```
from concurrent.futures import ProcessPoolExecutor


class ObjectWithPickleError():
    """Triggers a RuntimeError when sending job to the workers"""

    def __reduce__(self):
        raise RuntimeError()


if __name__ == "__main__":
    e = ProcessPoolExecutor()
    f = e.submit(id, ObjectWithPickleError())
    e.shutdown(wait=False)
    f.result()  # Deadlock on get
```

This is caused by the fact that the main process is closing communication channels that might be necessary to the `queue_management_thread` later. To avoid this, this PR let the `queue_management_thread` manage all the closing.



https://bugs.python.org/issue39104



Automerge-Triggered-By: @pitrou</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-39349: Add *cancel_futures* to Executor.shutdown() (GH-18057)</title>
<updated>2020-02-02T12:49:00+00:00</updated>
<author>
<name>Kyle Stanley</name>
<email>aeros167@gmail.com</email>
</author>
<published>2020-02-02T12:49:00+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=339fd46cb764277cbbdc3e78dcc5b45b156bb6ae'/>
<id>339fd46cb764277cbbdc3e78dcc5b45b156bb6ae</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typo in Lib/concurrent/futures/thread.py (GH-13953)</title>
<updated>2019-06-15T11:43:10+00:00</updated>
<author>
<name>ubordignon</name>
<email>48903745+ubordignon@users.noreply.github.com</email>
</author>
<published>2019-06-15T11:43:10+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=552ace7498722f1add9f3782751b0d365f4c24c8'/>
<id>552ace7498722f1add9f3782751b0d365f4c24c8</id>
<content type='text'>

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>

</pre>
</div>
</content>
</entry>
</feed>
