users@grizzly.java.net

Re: Grizzly 2.0 M3 infinite loop using multi-binding

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Tue, 16 Jun 2009 14:26:36 +0200

Hello,

> When I use multi-binding the server loops continuesly when I send a
> shutdown
> request to the command port.
>
> My idea was to create a Transport with different ServerConnection's,
> each
> with a custom Processor. Like this:
>
> for (X x: iterableSet)
> {
> String sAddress = x.getAddress();
> int iPort = x.getPort();
> Processor processor = x.getProcessor();
>
> Connection serverConnection = transport.bind(sAddress, iPort);
> serverConnection.setProcessor(processor);
> }
>
> When I sent a shutdown request (to one of the ServerConnections) an
> infinite
> loop started. So I looked into the code and saw this in
> TCPNIOServerConnection::registerAcceptedChannel:
>
> Processor processor = transport.getProcessor();
>
> When I replaced this with
>
> Processor processor = this.getProcessor();
>
> it worked fine. This also makes sense (to me at last ;-).
>
> Is this correct (the fix), or should I use the framework in a
> different way?
Currently I'd suggest to use different Transport instances, if you
want to use different FilterChains for each binding.
Cause ServerConnection it's just another type of Connection, which may
have own ProcessorSelector and Processor, and not sure it's correct to
assign ServerConnection's Processor and ProcessorSelector to accepted
Connections.


> In any case I think the infinite loop should be prevented.
100% agree. Can you pls. provide details (stacktrace) of infinite
loop, which happens.

Thank you very much for investigations!

WBR,
Alexey.



>
> --
> View this message in context: http://www.nabble.com/Grizzly-2.0-M3-infinite-loop-using-multi-binding-tp23886746p23886746.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>