]> granicus.if.org Git - python/commit
[3.6] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6160)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 20 Mar 2018 19:40:18 +0000 (12:40 -0700)
committerAntoine Pitrou <pitrou@free.fr>
Tue, 20 Mar 2018 19:40:18 +0000 (20:40 +0100)
commitf3e6eadbcf4f3e0fe53f4784485b1c8464c7d282
tree9b277c0729ada9ae3ee34570f8e3a882e5b816be
parent424f3dafea16fbaee55a30903af2d6717f4d4a6b
[3.6] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6160)

fstat may block for long time if the file descriptor is on a
non-responsive NFS server, hanging all threads. Most fstat() calls are
handled by _Py_fstat(), releasing the GIL internally, but but
_Py_fstat_noraise() does not release the GIL, and most calls release the
GIL explicitly around it.

This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs
when calling:
- mmap.mmap()
- os.urandom()
- random.seed()
(cherry picked from commit 4484f9dca9149da135bbae035f10a50d20d1cbbb)

Co-authored-by: Nir Soffer <nirsof@gmail.com>
Misc/NEWS.d/next/Library/2018-03-12-00-27-56.bpo-33021.m19B9T.rst [new file with mode: 0644]
Modules/mmapmodule.c
Python/random.c