hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: [HttpCore] HttpCore 4.0-beta1 release packages preview (3nd take)
Date Sun, 20 Jan 2008 12:20:26 GMT

On Sun, 2008-01-20 at 03:14 +0000, sebb wrote:
> Done some more testing.
> 
> Looks like the problem may be that when port 9998 is closed, sometimes
> the SelectionKey for the 9999 channel becomes invalid.
> 
> I created a wrapper class for SelectionKey in
> DefaultListeningIOReactor to keep track of calls to cancel(); this
> seems to show that the key can become invalid *without* being
> cancelled...
> 
> It's not clear how this happens.
> 

Hi Sebastian,

I think this is because the channel associated with that key gets closed
before the key itself is canceled. Ain't NIO fun?

I think I have found the cause of the problem. NIO code on Windows still
appears buggy or at the very least its behavior is inconsistent with
that of common *nix platforms.

I checked in a workaround for the problem and am in the process of doing
some final testing

> There is an "interesting" package private method
> AbstractSelectionKey#invalidate() which just sets valid=false. Could
> this be called internally?
> 
> Getting late; might try running that under debug tomorrow.
> 

Do not waste any more of your time on debugging. The problem is
perfectly reproducible on my single core Windows box and I should be
able to fix it in the course of the day

Oleg


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message