[ https://issues.apache.org/jira/browse/HTTPCLIENT-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17820065#comment-17820065 ]
ASF subversion and git services commented on HTTPCLIENT-2318: ------------------------------------------------------------- Commit 407b9152ccafa120ce9e9cd14325c3cc78eb20c1 in httpcomponents-client's branch refs/heads/master from Arturo Bernal [ https://gitbox.apache.org/repos/asf?p=httpcomponents-client.git;h=407b9152c ] HTTPCLIENT-2318 - Enhance PoolingHttpClientConnectionManager with isShutdown State Check. This commit introduces an `isShutdown` method to the `PoolingHttpClientConnectionManager` class, providing a thread-safe way to check whether the connection manager has been closed. The addition leverages an existing `AtomicBoolean` closed flag to ensure that the shutdown state can be queried reliably in concurrent environments. > Implement HttpClientConnectionManager#isShutdown > ------------------------------------------------ > > Key: HTTPCLIENT-2318 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2318 > Project: HttpComponents HttpClient > Issue Type: Improvement > Components: HttpClient (classic) > Reporter: Edmund Ham > Assignee: Arturo Bernal > Priority: Major > Time Spent: 1h 10m > Remaining Estimate: 0h > > 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! -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org