HttpClient connections throwing System.Net.Sockets.SocketException after 21 seconds #27232
Labels
area-System.Net.Http
question
Answer questions and provide assistance, not an issue with source code or documentation.
Milestone
We have an issue in our services (running ASP.Net Core 2.1) where it takes about 21 seconds for
HttpClient
to "realize" that the service it is trying to connect to is down.The message we finally get is:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
We then retry on a different service and that works, but it means our requests take 21+ seconds longer (and clients sometimes timeout because of it):
Is there a way to modify this timeout? Ideally we'd want it set to something more like 5 seconds.
It seems like it's a generic TCP timeout.
The text was updated successfully, but these errors were encountered: