dev@grizzly.java.net

Re: passing the IOException in ReadFilter to the Grizzly user

From: Harsha Godugu <Harsha.Godugu_at_Sun.COM>
Date: Tue, 04 Dec 2007 10:37:17 -0800

Jeanfrancois Arcand wrote:

> Hi,
>
> Harsha Godugu wrote:
>
>> Hi Jeanfrancois,
>>
>> How does Grizzly v1.6.0 handle the following scenario:
>> The underlying channel gets closed (unexpectedly, due to say some
>> network problem.. or loose contact etc.. and then backs up to live )
>> while reading data using ReadFilter. Consider this can happen on
>> both client and server side.
>>
>> I see that, the ReadFilter class sets an attribute in Context, in
>> case of an exception. But that same attribute is removed in the
>> postExecute(..) method of ReadFilter.
>
>
> Right, but just before we tell the SelectorHandler to cancel/close the
> SelectionKey.
>
> How does user of Grizzly know, if
>
>> there is an IO exception (ChannelClosedException..) while reading
>> data using the filter? Do we have state listeners of connection to
>> monitor connection state? (Similar to Controller state!)
>
>
> With the default ReadFilter, the user doesn't have the control as the
> ProtocolChain execution will be interrupted, meaning the next Filter
> will never get invoked. Why would you like to continue the execution
> when you know the connection is closed? We can make the behavior
> configurable if you have a scenario when ProtocolFilter needs to be
> invoked with a 'close' connection.

Well, we don't want to continue the execution of next filter where is
an IO exception. What I was looking for is, to know if there is an
exception while reading. I need to take certain actions upon IO
exception, for example, notify the waiters in the corba waiting room to
let them know that there is an connection problem and hence will bail
out all the waiters for response. There is another action, where we need
to kick-in retry logic for certain number of attempts to check if the
connection is back to live.

thanks,
Harsha

>
> Thanks
>
> -- Jeanfrancois
>
>
>>
>> Thanks,
>> Harsha
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>