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 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:17:09.588000000

Uploaded patch set 2.

-------------------------------------
author: Noah Dean
date: 2010-06-17 18:20:27.075000000

Patch Set 2: I would prefer that you didn't submit this

Terribly minor thing, but could you format the rest of the commit message?  It scrolls horizontally in my browser -- hate to see what that'd do in my terminal.  :)

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