adutra commented on code in PR #12566:
URL: https://github.com/apache/iceberg/pull/12566#discussion_r2001506536


##########
core/src/main/java/org/apache/iceberg/rest/HTTPClient.java:
##########
@@ -324,7 +327,10 @@ public void close() throws IOException {
         authSession.close();
       }
     } finally {
-      httpClient.close(CloseMode.GRACEFUL);
+      if (root) {
+        // Only close the underlying Apache HTTP client if this is a root 
HTTPClient.
+        httpClient.close(CloseMode.GRACEFUL);

Review Comment:
   I thought about that, but we need to proceed carefully: if you close the 
client returned by `client.withAuthSession(..)`, its auth session will be 
closed as well. And that is not correct, if the session is a contextual or 
table session that was cached.
   
   If we want to go down that route, we need to NEVER close the auth session 
inside HTTPClient.
   
   Are you OK with that? I can make the changes if so. (In fact, it's probably 
the most correct thing to do now that I think of it.)



-- 
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...@iceberg.apache.org

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


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

Reply via email to