]> granicus.if.org Git - python/commit
bpo-33021: Release the GIL during fstat() calls (GH-6019)
authorNir Soffer <nirsof@gmail.com>
Sun, 11 Mar 2018 23:39:22 +0000 (01:39 +0200)
committerAntoine Pitrou <pitrou@free.fr>
Sun, 11 Mar 2018 23:39:22 +0000 (00:39 +0100)
commit4484f9dca9149da135bbae035f10a50d20d1cbbb
tree3caa068402965d1f8a14407ea7b09fda5902ffbf
parente756f66c83786ee82f5f7d45931ae50a6931dd7f
bpo-33021: Release the GIL during fstat() calls (GH-6019)

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()
Misc/NEWS.d/next/Library/2018-03-12-00-27-56.bpo-33021.m19B9T.rst [new file with mode: 0644]
Modules/mmapmodule.c
Python/bootstrap_hash.c