Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Hi all,
We have an internal library that has core logics and lots of microservices are using it. Within the internal library, we have "HttpClientPool" where we are caching different HttpClient based on keys and microservices are using them. Recently, we've been seeing some of OOM errors on microservices when using HttpClients from our "HttpClientPool".
From https://issues.apache.org/jira/browse/HTTPCLIENT-2039 and https://issues.apache.org/jira/browse/HTTPCLIENT-1924 we understand that it is the intention to shutdown the connection pool in case of Java Errors. I'm now wondering if it's possible to have new API, "HttpClientConnectionManager#isShutdown" so that we as a library can identify if the connection pool is closed or not, before giving out to our clients?
Currently there seems to be no way to identify it, unless we actually try to make an outbound call and get "IllegalStateException: Connection pool shut down" exception message, which makes impossible for us to do because we as a library don't want to make additional HTTP client call every time when our client requests for the HttpClient instance.
Thanks!