Exception on connect being caught by response handler

jgalyan jgalyan at adbrite.com
Tue Nov 23 17:21:54 EST 2010


After further investigation, it turns out that the ConnectException getting
passed to the response handler's exceptionCaught was masking the call to
operationComplete in my listener.  I am unfortunately not able to get the
information I had wanted while in operationComplete, but I do at least know
that it is getting called and my logic for handling the situation is
running.

However, I still have a serious problem:
When a connection fails (i.e., the remote host has nothing listening on the
port I'm attempting to connect to), no request is sent to the cache server,
but netty is still invoking the upstream handlers as though a response has
been received: my replaying decoder gets called, then the upstream handler's
messageReceived method is called, which is causing NullPointerExceptions
because I'm using ChannelLocals to pass state between the downstream and the
upstream sides of the transaction, which works perfectly fine in another
project I used netty for.  Shouldn't the upstream decoder & handler only
ever get called if there has actually been a response?  Why is a
ConnectException causing messageReceived to fire in the upstream handlers,
*after* exceptionCaught is fired?

I've tested this by shutting down all cache servers in the cluster
completely, so I know there's no way a response is coming back to me.  I can
reproduce this every time.  I don't recall ever seeing this behavior before;
is this behavior intentional?
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Exception-on-connect-being-caught-by-response-handler-tp5764119p5768595.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list