Message400337
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 |
|
Date |
User |
Action |
Args |
2021-08-26 11:53:33 | uosiu | set | recipients:
+ uosiu |
2021-08-26 11:53:33 | uosiu | set | messageid: <1629978813.83.0.528049638414.issue45012@roundup.psfhosted.org> |
2021-08-26 11:53:33 | uosiu | link | issue45012 messages |
2021-08-26 11:53:33 | uosiu | create | |
|