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.

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 an unchecked exception and log an error:
it is a serious case because the node will be essentially lost and never re-queued.

Change-Id: I54930eb03f5c07fc6966f8d4d5db42548c63f6bd


COMMENTS

author: Allan Henderson
date: 2010-06-17 18:31:19.133000000

Uploaded patch set 4.

-------------------------------------
