Linux,net core, httpclient发送http请求的时候,偶现System.Net.Http.HttpRequestException: Resource temporarily unavailable
异常信息如下:
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)|Source:System.Net.Http|异常:{"Message":"Resource temporarily unavailable","Data":{},"InnerException":{"ClassName":"System.Net.Sockets.SocketException","Message":"Resource temporarily unavailable","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2147467259,"Source":"System.Private.CoreLib","WatsonBuckets":null,"NativeErrorCode":11},"StackTrace":" at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)\n at System.Threading.Tasks.ValueTask1.get_Result()\n at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at System.Threading.Tasks.ValueTask
1.get_Result()\n at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask1 creationTask)\n at System.Threading.Tasks.ValueTask
1.get_Result()\n at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)\n at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)\n at MerchantsApi.Proxies.OperateProxy.GetBlackListAsync(GetBlackListRequest requests) in /src/MerchantsApi/Proxies/OperateProxy.cs:line 51\n at MerchantsApi.Service.MerchantBalanceAuthenticationService.AuthAsync(BalanceInfo balance, PlatformInfo platformInfo, Boolean ifSkipRisk, Boolean verifyOnlyRisk) in /src/MerchantsApi/Service/MerchantBalanceAuthenticationService.cs:line 115\n at MerchantsApi.Controllers.BalanceController.VersionDataAsync(BillInfo info) in /src/MerchantsApi/Controllers/BalanceController.cs:line 470","HelpLink":null,"Source":"System.Net.Http","HResult":-2147467259}
代码看看
网址不稳定???
线程开多了,linux进行了资源限制
什么情况下会有线程开多的情况?
https://blog.csdn.net/chenlin465373800/article/details/78924780
我觉得可能时TCP链接数量达到系统限制。 打印一下netstat看看有多少链接。