Closed dlmu-lq closed 2 years ago
as the error implies the error is in Apache. You could create a custom Apache client for unirest that is configured with a NoConnectionReuseStrategy. that may have other negative performance consequences
I would note that using that strategy might help with a very flakey server but in the end this is a valid exception
@ryber Thank you for your reply, noticed that unirest have a thread AsyncIdleConnectionMonitorThread
, do the work : close connections idled 30s, any consideration to expose 30
as a config?
@ryber Or any consideration to allow users to custom set ConnectionKeepAliveStrategy
for httpClient may solve this problem?
I try to avoid getting too much into configuring apache with advanced things like the Connection Strategies. Users can configure an entire client to use. We could expose the IdleConnectionMonitor, although that is going away in the next major version because Unirest is switching to the Java 11 client
I'm going to close this. There is always the option to use the advanced features of Apache with a custom apache client. It's quite easy to set.
Describe the bug Server slb idle connections will be closed in 15s,but the time in client is 30s. So in some extreme circumstance,unirest client will use connections closed by server and throw an exception like: kong.unirest.UnirestException: org.apache.http.NoHttpResponseException: ** failed to respond
is there anyway to avoid this?