You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using NuGet.Protocol library for communication in NuGet plugins it could cause deadlocks in message processing on the plugin side and as result NuGet tasks fails with "was cancelled" messages like that:
[14:51:36][restore] Starting: C:\TeamCity\buildAgent\tools\NuGet.CommandLine.4.8.0-rtm.5369\tools\NuGet.exe restore C:\TeamCity\buildAgent\work\71412ac3a5525267\NuGetFeedTest.sln -NoCache -Verbosity detailed -Source http://localhost:8080/httpAuth/app/nuget/feed/_Root/default/v3/index.json -Source https://www.nuget.org/api/v2/
[14:51:36][restore] NuGet Version: 4.8.0.5369
[14:51:36][restore] MSBuild auto-detection: using msbuild version '15.6.82.30579' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
...
[14:51:37][restore] Restoring NuGet package NuGetFeedTest.0.0.314-beta.1.
[14:51:37][restore] GET http://localhost:8080/httpAuth/app/nuget/feed/_Root/default/v3/flatcontainer/nugetfeedtest/0.0.314-beta.1/nugetfeedtest.0.0.314-beta.1.nupkg
[14:51:37][restore] Using C:\TeamCity\buildAgent\plugins\nuget-agent/bin/credential-plugin/net46/CredentialProvider.TeamCity.exe as a credential provider plugin.
[14:51:38][restore] GET https://www.nuget.org/api/v2/Packages(Id='NuGetFeedTest',Version='0.0.314-beta.1')
[14:51:38][restore] NotFound https://www.nuget.org/api/v2/Packages(Id='NuGetFeedTest',Version='0.0.314-beta.1') 161ms
[14:51:38][restore] GET https://www.nuget.org/api/v2/FindPackagesById()?id='NuGetFeedTest'&semVerLevel=2.0.0
[14:51:38][restore] OK https://www.nuget.org/api/v2/FindPackagesById()?id='NuGetFeedTest'&semVerLevel=2.0.0 137ms
[14:51:42][restore] WARNING: Unable to find version '0.0.314-beta.1' of package 'NuGetFeedTest'.
[14:51:42][restore] https://www.nuget.org/api/v2/: Package 'NuGetFeedTest.0.0.314-beta.1' is not found on source 'https://www.nuget.org/api/v2/'.
[14:51:42][restore] http://localhost:8080/httpAuth/app/nuget/feed/_Root/default/v3/index.json: Getting package 'NuGetFeedTest.0.0.314-beta.1' from source 'http://localhost:8080/httpAuth/app/nuget/feed/_Root/default/v3/index.json' was cancelled.
[14:51:42][restore]
[14:51:43][restore] WARNING: Unable to find version '0.0.314-beta.1' of package 'NuGetFeedTest'.
[14:51:43][restore] https://www.nuget.org/api/v2/: Package 'NuGetFeedTest.0.0.314-beta.1' is not found on source 'https://www.nuget.org/api/v2/'.
[14:51:43][restore] http://localhost:8080/httpAuth/app/nuget/feed/_Root/default/v3/index.json: Getting package 'NuGetFeedTest.0.0.314-beta.1' from source 'http://localhost:8080/httpAuth/app/nuget/feed/_Root/default/v3/index.json' was cancelled.
[14:51:43][restore]
[14:51:43][restore] Errors in packages.config projects
[14:51:43][restore]
[14:51:43][restore] Unable to find version '0.0.314-beta.1' of package 'NuGetFeedTest'.
[14:51:43][restore] https://www.nuget.org/api/v2/: Package 'NuGetFeedTest.0.0.314-beta.1' is not found on source 'https://www.nuget.org/api/v2/'.
[14:51:43][restore] NuGet Config files used:
[14:51:43][restore] C:\Users\Dmitry.Tretyakov\AppData\Roaming\NuGet\NuGet.Config
[14:51:43][restore] C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
[14:51:43][restore] http://localhost:8080/httpAuth/app/nuget/feed/_Root/default/v3/index.json: Getting package 'NuGetFeedTest.0.0.314-beta.1' from source 'http://localhost:8080/httpAuth/app/nuget/feed/_Root/default/v3/index.json' was cancelled.
[14:51:43][restore]
[14:51:43][restore] Feeds used:
[14:51:43][restore] http://localhost:8080/httpAuth/app/nuget/feed/_Root/default/v3/index.json
[14:51:43][restore] https://www.nuget.org/api/v2/
[14:51:43][restore] Process exited with code 1
After adding ConfigureAwait(false) calls within NuGet.Protocol library this use case is unblocked and restore succeeds. Example: dtretyakov/NuGet.Client@e2a50bd
Details about Problem
When using
NuGet.Protocol
library for communication in NuGet plugins it could cause deadlocks in message processing on the plugin side and as result NuGet tasks fails with "was cancelled" messages like that:After adding
ConfigureAwait(false)
calls withinNuGet.Protocol
library this use case is unblocked and restore succeeds. Example: dtretyakov/NuGet.Client@e2a50bdSample Project
The typical use cause is executing logging during message processing from NuGet:
https://github.com/JetBrains/teamcity-nuget-support/blob/master/nuget-extensions/nuget-plugin/PluginController.cs#L21-L27
Originally was reported in the #6486 (comment)
//cc @jainaashish, @nkolev92, @dtivel
The text was updated successfully, but these errors were encountered: