DESCRIPTION

plug potential file descriptor leak

There is a problem in open/connect sequence that may produce file descriptor leaks in some abnormal conditions:
First, SocketChannel.open() is called, then ch.connect(a.getSocketAddress()) is called and it may throw an IOException under certain conditions.
Then we catch exception and re-queue the node. This will produce a leak since the channel was not closed.
	The problem surfaced because of some faulty changes that I made and which I fixed. But it's nevertheless a problem.
This is the Sun  bug reference. http://bugs.sun.com/view_bug.do?bug_id=6548464
They fixed it in a helper method that opens/connects in a single call. But in our case the client needs to take care of it.

One more small unrelated change is to catch and unchecked exception and log an error:
it is a serious case because the node will be essentially lost and never re-queued.


COMMENTS

