smengcl commented on code in PR #11454:
URL: https://github.com/apache/ozone/pull/11454#discussion_r4228175485
##########
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:
Fixed in 75f14ec07c1: both the background path and the caller fallback now
go through one helper that catches and logs the close failure.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
--
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]