-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2
-
None
I am seeing flakiness in code where QLockFile is locked/unlocked frequently. QLockFile::lock() fails with error code QLockFile::PermissionError when this happens. This means that Qt’s implementation calls CreateFile which fails with ERROR_ACCESS_DENIED.
The CreateFile documentation states
If you rename or delete a file and then restore it shortly afterward, the system searches the cache for file information to restore. Cached information includes its short/long name pair and creation time.
If you call CreateFile on a file that is pending deletion as a result of a previous call to DeleteFile, the function fails. The operating system delays file deletion until all handles to the file are closed. GetLastError returns ERROR_ACCESS_DENIED.
For Gerrit Dashboard: QTBUG-140053 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
674600,2 | Test that QLockFile::lock() and unlock() can be called multiple times | dev | qt/qtbase | Status: NEW | 0 | 0 |
674890,3 | QLockFile: Document intermittent failure situations for lock() | dev | qt/qtbase | Status: NEW | 0 | 0 |
676208,2 | wip QLockFile/win: Use SetFileInformationByHandle to delete while handle is held | dev | qt/qtbase | Status: NEW | -2 | 0 |
676395,1 | QLockFile/Win: replace DeleteFile with CreateFile w/o sharing | dev | qt/qtbase | Status: NEW | 0 | +1 |