Call InitializeTelemetrySession on background thread#58399
Conversation
jasonmalinowski
left a comment
There was a problem hiding this comment.
Slightly concerned about the lack of explicit option persister loading unless you now know that it's being triggered by somewhere else. But keeping it explicit would still be good I think.
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.cs
Outdated
Show resolved
Hide resolved
What does the explicit persister loading accomplish? It's loading in a fire and forget task on a background thread and there is no guarantee that other Roslyn code using options won't run before the explicit loading. |
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.cs
Show resolved
Hide resolved
Was the intention a best effort (w/o guarantee) to move loading assemblies off of UI thread, in case someone accesses the option service for the first time on UI thread? |
|
@jasonmalinowski Reverted removal of option providers pre-loading to lower risk. |
Fixes AB#1449211.
InitializeTelemetrySession accessed options which triggered assembly load that caused deadlock.
As per AB#296981, the
TelemetryService.DefaultSessionproperty must be accessed on UI thread but the rest of Roslyn telemetry service initialization can be run on background thread.The change moves telemetry initialization to VisualStudioWorkspaceImpl, so that it does not depend on RoslynPackage being loaded.