Exception on connect being caught by response handler

jgalyan jgalyan at adbrite.com
Tue Nov 30 17:33:29 EST 2010


Found the root cause: I'm using ChannelLocals to share state between the
client send side and receive sides of my transactions, and I was using
ChannelLocal.remove(Channel) to try to get the value out and remove it at
the same time, in order to keep the number of ChannelLocals from growing
ridiculously large.  The JavaDoc for ChannelLocal says that remove() returns
the removed value.  In actual practice, this was ALWAYS returning null,
which seems to have been causing the other exceptions (or was being
mis-reported by something as the other exceptions).  Changing my code to use
ChannelLocal.get(Channel) followed by ChannelLocal.remove(Channel) solved
the problem.  I hadn't looked at this part of the code because the
exceptions being reported (connection refused, etc.) didn't appear to be at
all related to this.

Perhaps the documentation for ChannelLocal.remove() could be updated to
reflect how it actually works?
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Exception-on-connect-being-caught-by-response-handler-tp5764119p5789892.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list