Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.12.5, 1.13.4, 1.14.0, 1.15.0
Description
In CacheClientNotifier.registerClientInternal client socket can be left half open and not properly closed when error conditions occur. Such as the case of:
} else { // The existing proxy is already running (which means that another // client is already using this durable id. unsuccessfulMsg = String.format( "The requested durable client has the same identifier ( %s ) as an existing durable client ( %s ). Duplicate durable clients are not allowed.", clientProxyMembershipID.getDurableId(), cacheClientProxy); logger.warn(unsuccessfulMsg); // Set the unsuccessful response byte. responseByte = Handshake.REPLY_EXCEPTION_DUPLICATE_DURABLE_CLIENT; }
It considers the current client connect attempt to have failed. It writes this response back to client: REPLY_EXCEPTION_DUPLICATE_DURABLE_CLIENT. This will cause the client to throw ServerRefusedConnectionException. What seems wrong about this method is that even though it sets "unsuccessfulMsg" and correctly sends back a handshake saying the client is rejected, it does not throw an exception and it does not close "socket". I think right before it calls performPostAuthorization it should do the followiing:
if (unsuccessfulMsg != null) { try { socket.close(); } catch (IOException ignore) { } } else { performPostAuthorization(...) }
Full discussion details can be found at https://markmail.org/thread/2gqmbq2m57pz7pxu