豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

RestoreOperationLogger.Do blocks thread pool threads #5663

@sharwell

Description

@sharwell

Using Visual Studio 2017 (15.3 Preview 6) to open Roslyn.sln.

RestoreOperationLogger.Do performs a blocking wait operation on thread pool threads totaling 1575 seconds, contributing to thread pool starvation. One of the following approaches should be used to avoid blocking calls on these threads:

  1. Make Do (and its callers) properly asynchronous.
  2. Use TaskCreationOptions.LongRunning (or equivalent) to ensure the call is made on a separate thread.

The following shows the back trace for this issue:

microsoft.visualstudio.threading.ni!JoinableTaskFactory.WaitSynchronously
microsoft.visualstudio.threading.ni!JoinableTask.CompleteOnCurrentThread
NuGet.SolutionRestoreManager!RestoreOperationLogger.Do
NuGet.SolutionRestoreManager!RestoreOperationLogger.Log
NuGet.Common!LoggerBase.Log
NuGet.Common!LoggerBase.LogInformation
NuGet.Commands!NuGet.Commands.RestoreRunner+<CommitAsync>d__8.MoveNext()
mscorlib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[System.__Canon].Start(!!0&)
NuGet.Commands!RestoreRunner.CommitAsync
NuGet.Commands!NuGet.Commands.RestoreRunner+<ExecuteAndCommitAsync>d__6.MoveNext()
mscorlib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[System.__Canon].Start(!!0&)
NuGet.Commands!RestoreRunner.ExecuteAndCommitAsync
NuGet.Commands!NuGet.Commands.RestoreRunner+<>c__DisplayClass2_0.<RunAsync>b__0()
mscorlib.ni!Task.Execute
mscorlib.ni!Task.ExecutionContextCallback
mscorlib.ni!ExecutionContext.Run
mscorlib.ni!Task.ExecuteWithThreadLocal
mscorlib.ni!Task.ExecuteEntry
mscorlib.ni!IThreadPoolWorkItem.ExecuteWorkItem
mscorlib.ni!_ThreadPoolWaitCallback.PerformWaitCallback

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions