From 0c09ed4dc00709870c5738cbe9a04dfc639413b6 Mon Sep 17 00:00:00 2001 From: Jameson Miller Date: Mon, 13 Aug 2018 14:30:38 -0400 Subject: [PATCH 1/2] Shutdown GitStatusCache before components it depends on Tweak the order that components are shutdown, to shutdown the GitStatusCache before other components that it depends on. This is to prevent problems that might arise from a component being disabled that GitStatusCache depends on. --- GVFS/GVFS.Virtualization/FileSystemCallbacks.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GVFS/GVFS.Virtualization/FileSystemCallbacks.cs b/GVFS/GVFS.Virtualization/FileSystemCallbacks.cs index 69973817a..906bad018 100644 --- a/GVFS/GVFS.Virtualization/FileSystemCallbacks.cs +++ b/GVFS/GVFS.Virtualization/FileSystemCallbacks.cs @@ -196,8 +196,11 @@ public void Stop() this.postFetchJobThread?.Abort(); } - this.fileSystemVirtualizer.PrepareToStop(); + // Shutdown the GitStatusCache before other + // components that it depends on. this.gitStatusCache.Shutdown(); + + this.fileSystemVirtualizer.PrepareToStop(); this.backgroundFileSystemTaskRunner.Shutdown(); this.GitIndexProjection.Shutdown(); this.BlobSizes.Shutdown(); From dfbe6579623acb650a633663c3212a19b3d15878 Mon Sep 17 00:00:00 2001 From: Jameson Miller Date: Tue, 14 Aug 2018 10:43:06 -0400 Subject: [PATCH 2/2] GVFSLock.Shared: correctly report whether lock was acquired This fixes a bug in TryAcquireGVFSLockForProcess where it does not correctly report whether it was able to acquire the GVFS lock. In cases where this method retries to acquire the lock, it would report success, even if it was not able to acquire the lock. This could lead to problems where commands that depended on the GVFS could run, even if it did not actually have the lock. --- GVFS/GVFS.Common/GVFSLock.Shared.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GVFS/GVFS.Common/GVFSLock.Shared.cs b/GVFS/GVFS.Common/GVFSLock.Shared.cs index 4f3fc5d7b..10785b445 100644 --- a/GVFS/GVFS.Common/GVFSLock.Shared.cs +++ b/GVFS/GVFS.Common/GVFSLock.Shared.cs @@ -81,13 +81,14 @@ public static bool TryAcquireGVFSLockForProcess( } }; + bool isSuccessfulLockResult; if (unattended) { - waitForLock(); + isSuccessfulLockResult = waitForLock(); } else { - ConsoleHelper.ShowStatusWhileRunning( + isSuccessfulLockResult = ConsoleHelper.ShowStatusWhileRunning( waitForLock, message, output: Console.Out, @@ -96,7 +97,7 @@ public static bool TryAcquireGVFSLockForProcess( } result = null; - return true; + return isSuccessfulLockResult; } public static void ReleaseGVFSLock(