Copilot commented on code in PR #11454:
URL: https://github.com/apache/ozone/pull/11454#discussion_r4228092469
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientManager.java:
##########
@@ -182,6 +197,25 @@ public void releaseClient(XceiverClientSpi client, boolean
invalidateClient,
}
}
+ /**
+ * Closes the client on a background thread. Closing can wait several
seconds for channel termination,
+ * so it should not run on the caller thread, which holds the clientCache
lock.
+ */
+ private void closeAsync(XceiverClientSpi client) {
+ try {
+ closeExecutor.execute(() -> {
+ try {
+ client.close();
+ } catch (RuntimeException e) {
+ LOG.warn("Failed to close client for pipeline {}",
client.getPipeline(), e);
+ }
+ });
+ } catch (RejectedExecutionException e) {
+ // too many clients are waiting to be closed, or this manager is already
closed
+ client.close();
+ }
Review Comment:
When the queue is full or the executor has been shut down, this fallback
bypasses the exception handling used by the asynchronous path. A
`RuntimeException` from `close()` therefore still propagates from
`releaseClient`/the removal callback under load, contrary to the stated
behavior that evicted-client close failures are logged instead of reaching the
caller. Apply the same catch-and-log behavior in this path (or route both paths
through one helper).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]