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.

Author uosiu
Recipients uosiu
Date 2021-08-26.11:53:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629978813.83.0.528049638414.issue45012@roundup.psfhosted.org>
In-reply-to
Content
We have an application that crawls filesystem using `os.scandir`. It uses multiple threads for various things. Application is used on variety of filesystems, some of them might be slow or occasionally unresponsive.

We have found out that sometimes whole crawling process is stuck and no thread makes any progress, even threads that are really simple, makes no IO and do not hold any locks. After running py-spy on process that was stuck we saw that one of the threads has entered `dentry.stat(follow_symlinks=False)` line and still holds the GIL. Other threads are stuck, because they are waiting for the GIL. This situation can take a long time.

I think that `DirEntry` should release GIL when stat cache is empty and syscall is performed.

This bug has already been fixed in `scandir` module. See: https://github.com/benhoyt/scandir/issues/131
History
Date User Action Args
2021-08-26 11:53:33uosiusetrecipients: + uosiu
2021-08-26 11:53:33uosiusetmessageid: <1629978813.83.0.528049638414.issue45012@roundup.psfhosted.org>
2021-08-26 11:53:33uosiulinkissue45012 messages
2021-08-26 11:53:33uosiucreate