You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by maf <ma...@andrew.com> on 2007/07/28 23:01:02 UTC
WriteFuture.join() hangs when exception thrown in filterWrite
I am a newbie to MINA and ran into this issue while coding a test case for my
app:
I am doing a write on a session and then doing a join() without timeout on
the resulting WriteFuture. An exception is thrown in the filterWrite method
of an I/O filter (in my test case I am actually using ProtocolCodecFilter
and the exception is thrown from my encoder). The test case results in the
join never returning, which hangs the containing thread.
My expectation would be that the framework would set the WriteFuture to
return false for isWritten() since the attempt to write failed. I also
implemented an exceptionCaught() handler in the filter and had it close the
session on the theory that the close() might clean up any pending
WriteFuture instances associated with the session, but that did not change
the behavior of the join.
The attached code (based on the netcat example) illustrates the behavior.
Marc
http://www.nabble.com/file/p11846476/WhenWriteFails.java WhenWriteFails.java
--
View this message in context: http://www.nabble.com/WriteFuture.join%28%29-hangs-when-exception-thrown-in-filterWrite-tf4163555s16868.html#a11846476
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
Re: WriteFuture.join() hangs when exception thrown in filterWrite
Posted by Trustin Lee <tr...@gmail.com>.
Thanks!
On 7/31/07, maf <ma...@andrew.com> wrote:
>
> I have created the following JIRA entry for this issue:
>
> http://issues.apache.org/jira/browse/DIRMINA-412
>
> Marc
>
>
> Trustin Lee wrote:
> >
> > Hi Marc,
> >
> > On 7/29/07, maf <ma...@andrew.com> wrote:
> >>
> >> I am a newbie to MINA and ran into this issue while coding a test case
> >> for my
> >> app:
> >>
> >> I am doing a write on a session and then doing a join() without timeout
> >> on
> >> the resulting WriteFuture. An exception is thrown in the filterWrite
> >> method
> >> of an I/O filter (in my test case I am actually using ProtocolCodecFilter
> >> and the exception is thrown from my encoder). The test case results in
> >> the
> >> join never returning, which hangs the containing thread.
> >>
> >> My expectation would be that the framework would set the WriteFuture to
> >> return false for isWritten() since the attempt to write failed. I also
> >> implemented an exceptionCaught() handler in the filter and had it close
> >> the
> >> session on the theory that the close() might clean up any pending
> >> WriteFuture instances associated with the session, but that did not
> >> change
> >> the behavior of the join.
> >>
> >> The attached code (based on the netcat example) illustrates the behavior.
> >
> > Thanks for the very detailed bug reporting. It could be prefect if
> > you created a JIRA entry:
> >
> > http://issues.apache.org/jira/browse/DIRMINA
> >
> > Thanks,
> > Trustin
> > --
> > what we call human nature is actually human habit
> > --
> > http://gleamynode.net/
> > --
> > PGP Key ID: 0x0255ECA6
> >
> >
>
> --
> View this message in context: http://www.nabble.com/WriteFuture.join%28%29-hangs-when-exception-thrown-in-filterWrite-tf4163555s16868.html#a11866792
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
>
>
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: WriteFuture.join() hangs when exception thrown in filterWrite
Posted by maf <ma...@andrew.com>.
I have created the following JIRA entry for this issue:
http://issues.apache.org/jira/browse/DIRMINA-412
Marc
Trustin Lee wrote:
>
> Hi Marc,
>
> On 7/29/07, maf <ma...@andrew.com> wrote:
>>
>> I am a newbie to MINA and ran into this issue while coding a test case
>> for my
>> app:
>>
>> I am doing a write on a session and then doing a join() without timeout
>> on
>> the resulting WriteFuture. An exception is thrown in the filterWrite
>> method
>> of an I/O filter (in my test case I am actually using ProtocolCodecFilter
>> and the exception is thrown from my encoder). The test case results in
>> the
>> join never returning, which hangs the containing thread.
>>
>> My expectation would be that the framework would set the WriteFuture to
>> return false for isWritten() since the attempt to write failed. I also
>> implemented an exceptionCaught() handler in the filter and had it close
>> the
>> session on the theory that the close() might clean up any pending
>> WriteFuture instances associated with the session, but that did not
>> change
>> the behavior of the join.
>>
>> The attached code (based on the netcat example) illustrates the behavior.
>
> Thanks for the very detailed bug reporting. It could be prefect if
> you created a JIRA entry:
>
> http://issues.apache.org/jira/browse/DIRMINA
>
> Thanks,
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
>
--
View this message in context: http://www.nabble.com/WriteFuture.join%28%29-hangs-when-exception-thrown-in-filterWrite-tf4163555s16868.html#a11866792
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
Re: WriteFuture.join() hangs when exception thrown in filterWrite
Posted by Trustin Lee <tr...@gmail.com>.
Hi Marc,
On 7/29/07, maf <ma...@andrew.com> wrote:
>
> I am a newbie to MINA and ran into this issue while coding a test case for my
> app:
>
> I am doing a write on a session and then doing a join() without timeout on
> the resulting WriteFuture. An exception is thrown in the filterWrite method
> of an I/O filter (in my test case I am actually using ProtocolCodecFilter
> and the exception is thrown from my encoder). The test case results in the
> join never returning, which hangs the containing thread.
>
> My expectation would be that the framework would set the WriteFuture to
> return false for isWritten() since the attempt to write failed. I also
> implemented an exceptionCaught() handler in the filter and had it close the
> session on the theory that the close() might clean up any pending
> WriteFuture instances associated with the session, but that did not change
> the behavior of the join.
>
> The attached code (based on the netcat example) illustrates the behavior.
Thanks for the very detailed bug reporting. It could be prefect if
you created a JIRA entry:
http://issues.apache.org/jira/browse/DIRMINA
Thanks,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6