shoothzj commented on code in PR #11016:
URL: https://github.com/apache/ignite/pull/11016#discussion_r1373945872
##########
modules/core/src/main/java/org/apache/ignite/internal/client/thin/io/gridnioserver/GridNioClientConnectionMultiplexer.java:
##########
@@ -146,8 +146,30 @@ public
GridNioClientConnectionMultiplexer(ClientConfiguration cfg) {
rwLock.readLock().lock();
try {
- SocketChannel ch = SocketChannel.open();
- ch.socket().connect(new InetSocketAddress(addr.getHostName(),
addr.getPort()), connTimeout);
+ SocketChannel ch = null;
+ try {
+ ch = SocketChannel.open();
+ ch.socket().connect(new InetSocketAddress(addr.getHostName(),
addr.getPort()), connTimeout);
+ }
+ catch (Exception e) {
+ if (ch != null) {
+ if (ch.socket() != null) {
+ try {
+ ch.socket().close();
+ }
+ catch (Exception ex) {
+ throw new
ClientConnectionException(ex.getMessage(), ex);
+ }
+ }
+ try {
+ ch.close();
+ }
+ catch (Exception ex) {
+ throw new ClientConnectionException(ex.getMessage(),
ex);
+ }
+ }
Review Comment:
I agree. Can we do some log here?
--
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]