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.