Azure上“计划服务”级别的SocketException

问题描述

在我的Application Insights日志中,我开始看到很多SocketException,但是从托管和运行我的服务的实际机器/天蓝色基础设施开始。我确定是某种原因导致了这种服务,但是我不知道如何进一步调试它。

考虑到它来自我没有权力的代码,stacktrace并没有真正给我很多工作,因为它被扔到了我的服务所在的实际机器上:

System.Net.Http.HttpRequestException:
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib,PublicKeyToken=b77a5c561934e089)
   at System.Net.Http.HttpClient+<FinishSendAsyncBuffered>d__58.MoveNext (System.Net.Http,Version=4.2.0.0,PublicKeyToken=b03f5f7f11d50a3a)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib,PublicKeyToken=b77a5c561934e089)
   at Microsoft.ServiceProfiler.Agent.FrontendClient.StampFrontendClient+<>c__DisplayClass9_0`1+<<HttpGetAsync>b__0>d.MoveNext (Microsoft.ServiceProfiler.Agent.FrontendClient,Version=2.6.1909.2701,PublicKeyToken=b77a5c561934e089)
   at Microsoft.ServiceProfiler.Agent.FrontendClient.StampFrontendClient+<HttpRequestAsync>d__12`1.MoveNext (Microsoft.ServiceProfiler.Agent.FrontendClient,PublicKeyToken=b77a5c561934e089)
   at Microsoft.ServiceProfiler.Agent.FrontendClient.StampFrontendClient+<HttpGetAsync>d__9`1.MoveNext (Microsoft.ServiceProfiler.Agent.FrontendClient,PublicKeyToken=b77a5c561934e089)
   at Microsoft.ServiceProfiler.Agent.FrontendClient.ProfilerFrontendClient+<GetEtlUploadAccessAsync>d__3.MoveNext (Microsoft.ServiceProfiler.Agent.FrontendClient,PublicKeyToken=b77a5c561934e089)
   at Microsoft.ServiceProfiler.Uploaders.StampEtlUploader+<UploadEtlZipFileAsync>d__1.MoveNext (ApplicationInsightsProfiler,PublicKeyToken=b77a5c561934e089)
   at Microsoft.ServiceProfiler.Collectors.DetailedTraceCollector+<UploadTraceAsync>d__41.MoveNext (ApplicationInsightsProfiler,PublicKeyToken=b77a5c561934e089)
   at Microsoft.ServiceProfiler.Collectors.DetailedTraceCollector+<StopCollectingAndUploadTraceAsync>d__38.MoveNext (ApplicationInsightsProfiler,PublicKeyToken=b77a5c561934e089)
   at Microsoft.ServiceProfiler.Engine+<>c__DisplayClass1_1+<<RunAsync>b__2>d.MoveNext (ApplicationInsightsProfiler,PublicKeyToken=b77a5c561934e089)
   at Microsoft.ServiceProfiler.Agent.Orchestration.Orchestrator+<TraceAsyncOperation>d__18.MoveNext (Microsoft.ServiceProfiler.Agent.Orchestration,PublicKeyToken=b03f5f7f11d50a3a)
Inner exception System.Net.WebException handled at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw:
   at System.Net.HttpWebRequest.EndGetResponse (System,PublicKeyToken=b77a5c561934e089)
   at System.Net.Http.HttpClientHandler.GetResponseCallback (System.Net.Http,PublicKeyToken=b03f5f7f11d50a3a)
Inner exception System.Net.Sockets.SocketException handled at System.Net.HttpWebRequest.EndGetResponse:
   at System.Net.Sockets.Socket.BeginConnectEx (System,PublicKeyToken=b77a5c561934e089)
   at System.Net.Sockets.Socket.UnsafeBeginConnect (System,PublicKeyToken=b77a5c561934e089)
   at System.Net.ServicePoint.ConnectSocketInternal (System,PublicKeyToken=b77a5c561934e089)

如果我查看门户网站,我所看到的只是它可能来自ApplicationInsightsProfiler的线索,再次与我的代码库毫无直接关系。

enter image description here

恐怕我会以某种方式耗尽http连接池,但是如何进一步调查呢?

解决方法

要检查您的http连接和SNAT端口,请在您的应用中打开“诊断并解决问题”,然后打开“可用性和性能”。从那里,您有2个选项卡可访问:“ SNAT端口耗尽”和“ TCP连接”。 在这里,您可以看到您的http连接及其目标。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...