I am trying to close the established connections when using the Hyperledger Fabric NodeJS SDK. Just running netstat -tlpan | grep 'ESTABLISHED.*[PID]'
where [PID] is the node process ID shows the number of established connections to peers and the event hub increasing continuously even after close is called on the channel.
This eventually leads to the OS hitting the max number of file descriptors. It is a network leak. Anyone with experience in cleaning this up? I think this is related to the GRPC stream.
The close channel and close peer, orderer does not kill the connections.
Here are the things I've tried:
- Getting the peer objects and deleting them
- Getting the stream to the server, calling end, cancel, deleting it, nullifying it
- Setting Channel to null
- Deleting the file descriptor from the shell -> Causes next transaction to fail
- Getting the client duplex stream object for the Event Hub and setting allowHalfOpen to false.
All from the client side, none of these sorts it out. Calling channel.close()
eventually limits the connections to 7050,7051 but not to 7053.
Any thoughts on this?