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:32:16.799000000

Uploaded patch set 5.

-------------------------------------
author: Noah Dean
date: 2010-06-17 18:36:56.910000000

Patch Set 5: Verified; Looks good to me, approved



-------------------------------------
author: Noah Dean
date: 2010-06-17 18:36:57.028000000

Change has been successfully cherry-picked as f8111142520726952a49f7c7f9c223680c224acf.

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