Merged PR 564242: Fix CreateFileW permission error in InMemoryArtifactContentCache due to sharing flag mismatch

Fixed a FileShare flag permission issue / race in LocalDiskContentStore.
This commit is contained in:
Kristijan Simic 2020-07-15 15:26:53 +00:00
Родитель 44e83f6d27
Коммит d3ad2d1133
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -913,7 +913,7 @@ namespace BuildXL.Engine.Cache.Artifacts
OpenFileResult openResultForWriting = FileUtilities.TryCreateOrOpenFile(
path,
FileDesiredAccess.GenericWrite | FileDesiredAccess.GenericRead,
FileShare.Read | FileShare.Delete,
FileShare.ReadWrite | FileShare.Delete,
FileMode.Open,
FileFlagsAndAttributes.FileFlagOverlapped | FileFlagsAndAttributes.FileFlagOpenReparsePoint | FileFlagsAndAttributes.FileFlagBackupSemantics,
out handle);
@ -988,7 +988,7 @@ namespace BuildXL.Engine.Cache.Artifacts
var attempt = FileUtilities.UsingFileHandleAndFileLength(
path.ExpandedPath,
FileDesiredAccess.GenericRead,
FileShare.Read | FileShare.Delete,
FileShare.ReadWrite | FileShare.Delete,
FileMode.Open,
flags,
(handle, length) =>

Просмотреть файл

@ -596,7 +596,7 @@ Versions/sym-sym-A -> sym-A/
public void ConcurrentCreationOfHardlinksPointingToSameFile()
{
var srcFile = CreateSourceFileWithPrefix(prefix: "hardlink-source.txt");
for (int i = 0; i < 5; i++)
for (int i = 0; i < 666; i++)
{
CreateAndSchedulePipBuilder(
description: "create-hardlink-" + i,