Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The DistributedMapCacheClient doesn't always properly close Sockets if it fails to connect. Both the SSLCommsSession and the StandardCommsSession classes have something like this in the constructor:
socketChannel = SocketChannel.open();
socketChannel.socket().connect(new InetSocketAddress(hostname, port), timeoutMillis);
If the call to `socketChannel.socket().connect()` throws an Exception, the Socket may or may not be closed, depending on the reason for the failure. We need to ensure that in this case we properly call socketChannel.close().
We should also check for any other spots where we may follow a similar pattern.
This issue can be identified because the instance can run out of open file handles. Running `lsof -p <pid>` will show a lot of Socket file handles being used, but `netstat` won't show these because there's no established connection. The `ss` command will include these in the `closed` count.
Attachments
Issue Links
- is fixed by
-
NIFI-8919 Refactor Distributed Cache Clients using Netty
- Resolved