This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: release GIL in nt._isdir
Type: behavior Stage: resolved
Components: Library (Lib), Windows Versions: Python 3.6, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: eryksun, jeremyspiegel, paul.moore, python-dev, r.david.murray, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: patch

Created on 2016-07-16 20:13 by jeremyspiegel, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
_isdir.patch jeremyspiegel, 2016-07-16 20:13 review
_isdir.2.7.patch jeremyspiegel, 2016-07-16 22:41 2.7 posix__isdir patch review
Messages (8)
msg270583 - (view) Author: Jeremy Spiegel (jeremyspiegel) * Date: 2016-07-16 20:13
In Modules/posixmodule.c, the function os__isdir_impl calls GetFileAttributesA/GetFileAttributesW without releasing the GIL. This is problematic since it can result in disk or network I/O, depending on the filesystem.
msg270588 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-07-16 22:18

This is the kind of patch I can't wait to have a one-click merge button... right now it'll have to wait until I have a clean repo. But if anyone else wants to get it, go ahead.
msg270591 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2016-07-16 22:29
Should this be backported to 2.7 posix__isdir()?
msg270594 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-07-16 23:39
No, it's not a security fix, so it doesn't go in 2.7.
msg270597 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2016-07-17 00:28
OK. I thought fixing bugs in 2.7 was at the discretion of core developers, including small tweaks for performance -- just not enhancements with significant amounts of new code and features.
msg270601 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-07-17 01:55
Maybe so. If you find a core developer who cares about performance in 2.7, maybe they'll merge it :)
msg270643 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-07-17 15:02
Correct, 2.7 is not in security fix only mode (yet), but new features (anything that changes an API) or bug fixes that we wouldn't put in a maintenance release (things that would break existing programs) are not allowed.  A special exception has been made for 2.7 for performance enhancements; we wouldn't normally do those in a maintenance release unless they were significant.

But as Steve says, it depends on a core developer being interested in applying the fix/backport.  Which we may have, we'll wait and see :)
msg270684 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-07-18 03:50
New changeset ebf9a4c933e9 by Steve Dower in branch '3.5':
Issue #27533: Release GIL in nt._isdir

New changeset 8823c660820e by Steve Dower in branch 'default':
Issue #27533: Release GIL in nt._isdir
Date User Action Args
2022-04-11 14:58:33adminsetgithub: 71720
2016-07-18 03:51:06steve.dowersetstatus: open -> closed
assignee: steve.dower
resolution: fixed
stage: patch review -> resolved
2016-07-18 03:50:51python-devsetnosy: + python-dev
messages: + msg270684
2016-07-17 15:02:53r.david.murraysetnosy: + r.david.murray
messages: + msg270643
2016-07-17 01:55:18steve.dowersetmessages: + msg270601
2016-07-17 00:28:20eryksunsetmessages: + msg270597
2016-07-16 23:39:32steve.dowersetmessages: + msg270594
2016-07-16 22:41:22jeremyspiegelsetfiles: + _isdir.2.7.patch
2016-07-16 22:40:37jeremyspiegelsetfiles: - _isdir.2.7.patch
2016-07-16 22:39:49jeremyspiegelsetfiles: + _isdir.2.7.patch
2016-07-16 22:29:00eryksunsetnosy: + eryksun
messages: + msg270591
2016-07-16 22:18:08steve.dowersettype: behavior
stage: patch review
messages: + msg270588
versions: + Python 3.5, Python 3.6
2016-07-16 21:26:03r.david.murraysetnosy: + paul.moore, tim.golden, zach.ware, steve.dower
components: + Windows
2016-07-16 20:13:54jeremyspiegelcreate