Skip to content

Commit c51353e

Browse files
authored
Merge pull request #9864 from drewnoakes/remove-watson-reporting
Remove Watson report settings
2 parents 1d6c6ac + 6aa03f1 commit c51353e

File tree

12 files changed

+25
-116
lines changed

12 files changed

+25
-116
lines changed

src/Common/BannedSymbols.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ M:Microsoft.VisualStudio.Threading.TplExtensions.Forget(System.Threading.Tasks.T
5454
M:Microsoft.VisualStudio.Shell.VsTaskLibraryHelper.FileAndForget(System.Threading.Tasks.Task,System.String,System.String,System.Func{System.Exception,System.Boolean}); Use IProjectFaultHandlerService.Forget to ensure that failed tasks are reported as non-fatal watsons and assigned to the correct component
5555
M:Microsoft.VisualStudio.Shell.VsTaskLibraryHelper.FileAndForget(Microsoft.VisualStudio.Threading.JoinableTask,System.String,System.String,System.Func{System.Exception,System.Boolean}); Use IProjectFaultHandlerService.Forget to ensure that failed tasks are reported as non-fatal watsons and assigned to the correct component
5656

57-
M:Microsoft.VisualStudio.ProjectSystem.IProjectFaultHandlerService.HandleFaultAsync(System.Exception,Microsoft.VisualStudio.ProjectSystem.ErrorReportSettings,Microsoft.VisualStudio.ProjectSystem.ProjectFaultSeverity,Microsoft.VisualStudio.ProjectSystem.UnconfiguredProject); Use IProjectFaultHandlerService.ReportFaultAsync to ensure that failed tasks are reported as non-fatal watsons and assigned to the correct component
58-
M:Microsoft.VisualStudio.ProjectSystem.IProjectFaultHandlerService.RegisterFaultHandler(System.Threading.Tasks.Task,Microsoft.VisualStudio.ProjectSystem.ErrorReportSettings,Microsoft.VisualStudio.ProjectSystem.ProjectFaultSeverity,Microsoft.VisualStudio.ProjectSystem.UnconfiguredProject); Use IProjectFaultHandlerService.Forget to ensure that failed tasks are reported as non-fatal watsons and assigned to the correct component
59-
M:Microsoft.VisualStudio.ProjectSystem.IProjectFaultHandlerService.RegisterFaultHandler`1(System.Threading.Tasks.Task{``0},Microsoft.VisualStudio.ProjectSystem.ErrorReportSettings,Microsoft.VisualStudio.ProjectSystem.ProjectFaultSeverity,Microsoft.VisualStudio.ProjectSystem.UnconfiguredProject); Use IProjectFaultHandlerService.Forget to ensure that failed tasks are reported as non-fatal watsons and assigned to the correct component
60-
6157
M:Microsoft.VisualStudio.Telemetry.PostFault(Microsoft.VisualStudio.Telemetry.TelemetrySession,System.String,System.String);Use IProjectFaultHandlerService.Forget to ensure that failed tasks are reported as non-fatal watsons and assigned to the correct component
6258
M:Microsoft.VisualStudio.Telemetry.PostFault(Microsoft.VisualStudio.Telemetry.TelemetrySession,System.String,System.String,System.Exception);Use IProjectFaultHandlerService.Forget to ensure that failed tasks are reported as non-fatal watsons and assigned to the correct component
6359
M:Microsoft.VisualStudio.Telemetry.PostFault(Microsoft.VisualStudio.Telemetry.TelemetrySession,System.String,System.String,System.Exception,System.Func{Microsoft.VisualStudio.Telemetry.IFaultUtility,System.Int32});Use IProjectFaultHandlerService.Forget to ensure that failed tasks are reported as non-fatal watsons and assigned to the correct component

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Debug/LaunchProfilesDebugLaunchProvider.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,22 @@ public void OnComplete(int hr, uint debugTargetCount, VsDebugTargetProcessInfo[]
168168
processInfoArray.Length == 1 &&
169169
vsLaunchedProcess is not null)
170170
{
171-
projectFaultHandlerService.Forget(
171+
projectFaultHandlerService.RegisterFaultHandler(
172172
targetsProvider5.OnAfterLaunchAsync(launchOptions, activeProfile, debugLaunchSettings[0], vsLaunchedProcess, processInfoArray[0]),
173-
unconfiguredProject);
173+
project: unconfiguredProject);
174174
}
175175
else
176176
{
177-
projectFaultHandlerService.Forget(
177+
projectFaultHandlerService.RegisterFaultHandler(
178178
targetsProvider4.OnAfterLaunchAsync(launchOptions, activeProfile, processInfoArray),
179-
unconfiguredProject);
179+
project: unconfiguredProject);
180180
}
181181
}
182182
else if (targetsProvider is not null)
183183
{
184-
projectFaultHandlerService.Forget(
184+
projectFaultHandlerService.RegisterFaultHandler(
185185
targetsProvider.OnAfterLaunchAsync(launchOptions, activeProfile),
186-
unconfiguredProject);
186+
project: unconfiguredProject);
187187
}
188188
}
189189

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/LanguageServices/LanguageServiceHost.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ protected override async Task InitializeCoreAsync(CancellationToken cancellation
162162
_firstPrimaryWorkspaceSet.TrySetException(ex);
163163

164164
// Report the exception as an NFE that limits the functionality of the project.
165-
_ = _projectFaultHandler.ReportFaultAsync(ex, _unconfiguredProject, ProjectFaultSeverity.LimitedFunctionality);
165+
_ = _projectFaultHandler.HandleFaultAsync(ex, project: _unconfiguredProject, severity: ProjectFaultSeverity.LimitedFunctionality);
166166
},
167167
CancellationToken.None,
168168
TaskContinuationOptions.OnlyOnFaulted,
@@ -360,7 +360,7 @@ public async Task AfterLoadInitialConfigurationAsync()
360360

361361
// While we want make sure it's loaded before PrioritizedProjectLoadedInHost,
362362
// we don't want to block project factory completion on its load, so fire and forget.
363-
_projectFaultHandler.Forget(result, _unconfiguredProject, ProjectFaultSeverity.LimitedFunctionality);
363+
_projectFaultHandler.RegisterFaultHandler(result, project: _unconfiguredProject, severity: ProjectFaultSeverity.LimitedFunctionality);
364364
}
365365
}
366366

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/LanguageServices/Workspace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ async Task ProcessInitialEvaluationDataAsync(CancellationToken cancellationToken
304304
{
305305
_state = WorkspaceState.Failed;
306306

307-
await _faultHandlerService.ReportFaultAsync(ex, _unconfiguredProject, ProjectFaultSeverity.LimitedFunctionality);
307+
await _faultHandlerService.HandleFaultAsync(ex, project: _unconfiguredProject, severity: ProjectFaultSeverity.LimitedFunctionality);
308308

309309
_context?.Dispose();
310310

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/PackageRestore/NuGetRestoreService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,6 @@ private void RegisterProjectRestoreInfoSource()
232232
});
233233
#pragma warning restore RS0030 // Do not used banned APIs
234234

235-
_faultHandlerService.Forget(registerRestoreInfoSourceTask, _project, ProjectFaultSeverity.Recoverable);
235+
_faultHandlerService.RegisterFaultHandler(registerRestoreInfoSourceTask, project: _project);
236236
}
237237
}

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Setup/SetupComponentProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public Task LoadAsync()
5757
// Don't block on initialization here. It doesn't need to complete before we continue here,
5858
// and initialization will wait on some features of the project to become available, which would
5959
// cause a deadlock if we waited here. We file this so any exception is reported as an NFE.
60-
_projectFaultHandlerService.Forget(task, _unconfiguredProject, ProjectFaultSeverity.LimitedFunctionality);
60+
_projectFaultHandlerService.RegisterFaultHandler(task, project: _unconfiguredProject, severity: ProjectFaultSeverity.LimitedFunctionality);
6161

6262
return Task.CompletedTask;
6363
}

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Setup/SetupComponentRegistrationService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private void TryPublish()
204204
{
205205
Task task = _missingComponentRegistrationService.RegisterMissingComponentsAsync(missingComponentsByProjectGuid, cancellationToken: default);
206206

207-
_projectFaultHandlerService.Forget(task, project: null, ProjectFaultSeverity.Recoverable);
207+
_projectFaultHandlerService.RegisterFaultHandler(task);
208208
}
209209

210210
return;

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/UpToDate/UpToDateCheckBuildEventNotifier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ int IVsUpdateSolutionEvents2.UpdateProjectCfg_Done(IVsHierarchy pHierProj, IVsCf
110110
}
111111
});
112112

113-
_faultHandlerService.Forget(task.Task, unconfiguredProject);
113+
_faultHandlerService.RegisterFaultHandler(task.Task, project: unconfiguredProject);
114114
}
115115
}
116116

src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/DataflowBlockFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ private static void RegisterFaultHandler(IDataflowBlock block, UnconfiguredProje
4848
Task faultTask = faultHandlerService.RegisterFaultHandlerAsync(block, project, severity);
4949

5050
// We don't actually care about the result of reporting the fault if one occurs
51-
faultHandlerService.Forget(faultTask, project);
51+
faultHandlerService.RegisterFaultHandler(faultTask, project: project);
5252
}
5353
}

src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchSettingsProvider.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ protected override void Initialize()
233233
// establish the file watcher. We don't need wait this, because files can be changed in the system anyway, so blocking our process
234234
// doesn't provide real benefit. It is of course possible that the file is changed before the watcher is established. To eliminate this
235235
// gap, we can recheck file after the watcher is established. I will skip this for now.
236-
_project.Services.FaultHandler.Forget(
236+
_project.Services.FaultHandler.RegisterFaultHandler(
237237
_launchSettingFileWatcher.GetValueAsync(),
238-
_project,
238+
project: _project,
239239
severity: ProjectFaultSeverity.LimitedFunctionality);
240240
}
241241

@@ -606,9 +606,9 @@ protected override void Dispose(bool disposing)
606606
{
607607
if (disposing)
608608
{
609-
_project.Services.FaultHandler.Forget(
609+
_project.Services.FaultHandler.RegisterFaultHandler(
610610
_launchSettingFileWatcher.DisposeValueAsync(),
611-
_project,
611+
project: _project,
612612
severity: ProjectFaultSeverity.Recoverable);
613613

614614
FileChangeScheduler?.Dispose();
@@ -935,6 +935,6 @@ private async Task<ILaunchSettings> GetSnapshotThrowIfErrorsAsync()
935935
public void OnFilesChanged(IReadOnlyCollection<(string FilePath, FileWatchChangeKinds FileWatchChangeKinds)> changes)
936936
{
937937
_diagnosticOutputService?.WriteLine(string.Join(Environment.NewLine, changes.Select(change => $"File changed: {change.FilePath} ({change.FileWatchChangeKinds})")));
938-
_projectFaultHandler.Forget(HandleLaunchSettingsFileChangedAsync(), _project);
938+
_projectFaultHandler.RegisterFaultHandler(HandleLaunchSettingsFileChangedAsync(), project: _project);
939939
}
940940
}

0 commit comments

Comments
 (0)