risdenk commented on code in PR #848:
URL: https://github.com/apache/solr/pull/848#discussion_r868760728


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java:
##########
@@ -250,16 +250,18 @@ private HttpClient createHttpClient(Builder builder) {
   public void close() {
     // we wait for async requests, so far devs don't want to give sugar for 
this
     asyncTracker.waitForComplete();
-    if (closeClient) {
-      try {
+    try {
+      if (closeClient) {
         httpClient.setStopTimeout(1000);
         httpClient.stop();
-      } catch (Exception e) {
-        throw new RuntimeException("Exception on closing client", e);
+        httpClient.destroy();

Review Comment:
   
https://www.eclipse.org/jetty/javadoc/jetty-9/org/eclipse/jetty/client/HttpClient.html
 is `Destroyable` 
(https://www.eclipse.org/jetty/javadoc/jetty-9/org/eclipse/jetty/util/component/Destroyable.html)
   
   > Typically a Destroyable is a 
[LifeCycle](https://www.eclipse.org/jetty/javadoc/jetty-9/org/eclipse/jetty/util/component/LifeCycle.html)
 component that can hold onto resources over multiple start/stop cycles. A call 
to destroy will release all resources and will prevent any further start/stop 
cycles from being successful.
   
   So I think we actually want to destroy the `httpClient` here since we can't 
start the `HttpClient` again anyway...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to