Connected host has failed to respond

Hi,

I have setup the env_variable RHINO_COMPUTE_TIMEOUT to 100000 value as my computations are very heavy. I set same timeout value for my python script from where I calling my custom endpoint. Still after like 10-12 minutes I am getting following error and surprisingly compute is still executing generating output files after this error.

System.Net.WebException: An error occurred while sending the request.
 ---> System.Net.Http.HttpRequestException: An error occurred while sending the request.
 ---> System.IO.IOException: Unable to read data from the transport connection: 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..
 ---> System.Net.Sockets.SocketException (10060): 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.
   at System.Net.Sockets.NetworkStream.Read(Span`1 buffer)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Span`1 buffer)
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.Metrics.MetricsHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.SocketsHttpHandler.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.Send(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at System.Net.HttpWebRequest.SendRequest(Boolean async)
   at System.Net.HttpWebRequest.GetResponse()
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at Rhino.Compute.ComputeServer.DoPost(String function, String json)
   at Rhino.Compute.ComputeServer.PostWithConverter[T](String function, JsonConverter converter, Object[] postData)
   at Rhino.Compute.ComputeServer.Post[T](String function, Object[] postData)
   at Rhino.Compute.GrasshopperCompute.EvaluateDefinition(String definition, IEnumerable`1 trees)
   at PartAnalyzer.PartAnalyzerComponent.RunPartAnalyze```

I don't know what is going wrong. Can anyone please help me here ?

Regards,
Shivam

Sorry the time is always in between 5 mins 15-50 seconds while getting this error

sorry @AndyPayne for tagging you directly. sincere apologies.

We are just a step away from deploying our GH definition on production for the first time. out of blue we are facing this issue exactly after 5 mins and some seconds. in the background the results are getting generated and the response code is also 200 after this issue.
I don’t know what could be the reason. I added compute.timeout to be around 1 hour in RhinoCompute.cs in my custom endpoint. added RHINO_COMPUTE_TIMEOUT as env variable . Increased idletimespan and IIS timeout as well. still facing the same issue

Hi

Issue got resolved. I will write the solution for future reference to anyone facing similar issue.

RhinoCompute.cs uses System.Net.HttpWebRequest while calling the compute. There are 2 timeout properties defined in this class

  1. Timeout β†’ which is request timeout that you can maintain
  2. ReadWriteTimeout β†’ this is require for tcp connection read/write stream data timeout.

I was missing the 2nd property and that is why I was facing above issue. Now that I have set it up for longer time it is working properly.

Thanks and sorry @AndyPayne for troubling you.

Thanks,
Shivam

1 Like