2

Summary

We have been experiencing a rogue CurlException being thrown without a very meaningful stack trace in an dotnetcore 2 ASP.NET app. This seems to be sent to AI from the AI Dependency Tracking Module. It's really just an annoyance in our logs, because it surfaces in our code as an Http response message from HttpClient. Is this a bug in System.Net.Http where it's logging an exception when it shouldn't? Is there a way to disable this, other than by disabling all of dependency tracking?

Environment

  • .NET Core 2.1.4
  • Host: Ubuntu 16.04 (Xenial) on an Azure Scale Set

Exception info (from Application Insights)

problemId: System.Net.Http.CurlException at System.Net.Http.CurlHandler.ThrowIfCURLEError
type: System.Net.Http.CurlException
assembly: System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
method: ystem.Net.Http.CurlHandler.ThrowIfCURLEError
outerType: System.Net.Http.HttpRequestException
outerMessage: An error occurred while sending the request.
outerAssembly: System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
outerMethod: System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
innermostType: System.Net.Http.CurlException
innermostMessage: Couldn't connect to server
parsed stack trace:
{"assembly":"System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"System.Net.Http.CurlHandler.ThrowIfCURLEError","level":0,"line":0}
{"assembly":"System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","method":"System.Net.Http.CurlHandler+MultiAgent.FinishRequest","level":1,"line":0}
sdkVersion: rdddsc:2.5.0-33031
Adrian
  • 251
  • 1
  • 5
  • I suspect this is some background thread thing that happens in a thread we didn't create, given that the call stack is so spartan. I wonder if it's something that happens on startup / shutdown of the app in the cluster we're running on, since we run this asp.net core app on 30 machines in a scaleset. – Kelly L Mar 20 '18 at 20:42
  • it seems like the thread this would be on is: https://github.com/dotnet/corefx/blob/94e4bc6e888825d2ad8f373c9bbc1b279608349b/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.MultiAgent.cs#L162 – Kelly L Mar 20 '18 at 20:43
  • and that the expected behavior would be for this line: https://github.com/dotnet/corefx/blob/94e4bc6e888825d2ad8f373c9bbc1b279608349b/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.MultiAgent.cs#L576 and its callee to throw here: https://github.com/dotnet/corefx/blob/94e4bc6e888825d2ad8f373c9bbc1b279608349b/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.MultiAgent.cs#L877 – Kelly L Mar 20 '18 at 20:44
  • and then set the exception here: https://github.com/dotnet/corefx/blob/94e4bc6e888825d2ad8f373c9bbc1b279608349b/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.MultiAgent.cs#L888 and here: https://github.com/dotnet/corefx/blob/94e4bc6e888825d2ad8f373c9bbc1b279608349b/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.EasyRequest.cs#L203 – Kelly L Mar 20 '18 at 20:44

0 Answers0