microsoft / microsoft/VFSForGit

Mount race condition could result in access exception on 'ModifiedPaths.dat'

Open
#452 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

affects: live-site affects: mount-reliability
Dominant language
C#
Stars
6.1k
Forks
474
Avg merge
2d 4h
Merged PRs (30d)
8

Description

Repo Steps:

  1. Open two command prompts
  2. Call mount in both at the same time
    Both calls will look like successful mount starts. In the background you'll see the below exception from one of the processes.

The problem is we don't know if this is a real access issue or if simply mount is being called twice without a lot of digging. Cleaning up the telemetry here would help. Perhaps we should check to see if we can open a pipe first before accessing the file.

Failed to create src folder callback listener GVFS.Common.InvalidRepoException: System.IO.IOException: The process cannot access the file 'C:\ModifiedPaths.dat' because it is being used by another process.
at GVFS.Common.FileBasedCollection.OpenOrCreateDataFile(Boolean retryUntilSuccess)
at GVFS.Common.FileBasedCollection.TryLoadFromDisk[TKey,TValue](TryParseAdd2 tryParseAdd, TryParseRemove1 tryParseRemove, Action2 add, String& error, Action synchronizedAction) at GVFS.Virtualization.FileSystemCallbacks..ctor(GVFSContext context, GVFSGitObjects gitObjects, RepoMetadata repoMetadata, BlobSizes blobSizes, GitIndexProjection gitIndexProjection, BackgroundFileSystemTaskRunner backgroundFileSystemTaskRunner, FileSystemVirtualizer fileSystemVirtualizer, GitStatusCache gitStatusCache) at GVFS.Mount.InProcessMount.<>c__DisplayClass32_0.<MountAndStartWorkingDirectoryCallbacks>b__1() in E:\A\_work\304\s\GVFS\GVFS.Mount\InProcessMount.cs:line 517 at GVFS.Mount.InProcessMount.CreateOrReportAndExit[T](Func1 factory, String reportMessage) in E:\A_work\304\s\GVFS\GVFS.Mount\InProcessMount.cs:line 217

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two-command prompt mount race, then start with GVFS.Mount/InProcessMount.cs at MountAndStartWorkingDirectoryCallbacks (line 517) and CreateOrReportAndExit (line 217). Trace FileSystemCallbacks and FileBasedCollection.OpenOrCreateDataFile to determine whether the ModifiedPaths.dat access exception is expected during concurrent mounts. Done means the telemetry distinguishes this race from a real access failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.