Skip to content

Commit

Permalink
Merge pull request #1668: ProductUpgradeTimer: remove unacceptable En…
Browse files Browse the repository at this point in the history
…vironment.Exit()

A user reported an issue via the Teams channel. Looking at the diagnose logs I saw that the user's `GVFS.Service` was restarting in a loop with an exception tracking down to this `Environment.Exit()` call.

It's completely unacceptable to exit here, as it kills the service and then it restarts. Better to have no upgrades than to let this continue.

The cause of this exception was a missing executable when checking `ProjFS.IsGVFSUpgradeSupported()`, which seems to call PowerShell. The only reason the stack would have a `Win32Exception` with "The system cannot find the file specified" is that `powershell.exe` is not on the `PATH`, which was fixed in #1658.
  • Loading branch information
derrickstolee authored May 28, 2020
2 parents 90deaef + f444c83 commit 55b7f52
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions GVFS/GVFS.Service/ProductUpgradeTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,12 @@ private void TimerCallback(object unusedState)
this.DisplayUpgradeAvailableToast(newerVersion.ToString());
}
}
catch (Exception ex) when (
ex is IOException ||
ex is UnauthorizedAccessException ||
ex is NotSupportedException)
catch (Exception ex)
{
this.tracer.RelatedWarning(
CreateEventMetadata(ex),
"Exception encountered recording highest available version");
}
catch (Exception ex)
{
this.tracer.RelatedError(
CreateEventMetadata(ex),
"Unhanlded exception encountered recording highest available version");
Environment.Exit((int)ReturnCode.GenericError);
}
}
}

Expand Down

0 comments on commit 55b7f52

Please sign in to comment.