You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2025/06/05 09:37:04 UTC
Re: [PR] SSL_Handshake: close nio channel when NioClient fail to handshake wit… [cloudstack]
Copilot commented on code in PR #10153:
URL: https://github.com/apache/cloudstack/pull/10153#discussion_r2128408909
##########
utils/src/main/java/com/cloud/utils/nio/NioClient.java:
##########
@@ -79,6 +79,7 @@ protected void init() throws IOException {
_selector.close();
throw new IOException("Failed to initialise security", e);
} catch (final IOException e) {
+ _clientConnection.close();
Review Comment:
Consider wrapping _clientConnection.close() in a try-catch block to ensure that any exception thrown during the close operation does not obscure the original IOException and to better manage resource cleanup.
```suggestion
try {
_clientConnection.close();
} catch (final IOException closeException) {
logger.error("Failed to close _clientConnection", closeException);
}
```
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org