mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederic Soulier <frede...@wallaby.uklinux.net>
Subject Re: Close future join behavior
Date Thu, 21 Sep 2006 15:14:31 GMT
On Thu, 2006-09-21 at 23:33 +0900, Trustin Lee wrote:
> Hello Steve,
> On 9/21/06, Steve Bate <steve@technoetic.com> wrote:
> >
> > I have some code where I want to close my session and not return from the
> > current method until the close is complete. I wrote something similar
> > to...
> >
> > iosession.close().join();
> >
> > This code is called during a session's exceptionCaught filter chain
> > invocation. The problem is that the callback happens in the socket io
> > processor thread and the thread blocks in the join() operation so the
> > close
> > future status never set.
> Did you add the filter *before* the ThreadPoolFilter (or ExecutorFilter)?
> Then it can happen.  Please try to add your filter after the
> ThreadPoolFilter.  If you are using the latest release of MINA and don't
> need to add a ThreadPoolFilter by yourself; it's added by default.  If you
> are adding your filter by calling addFirst, then please try to add it by
> calling addLast.
> Am I doing something incorrect here or is this a bug? The code fragment
> > described above is also called from application threads (without blocking
> > indefinitely, as expected). Any advice?
> I think it is not really a bug. We just need more documentation.  As you
> figured out, it is impossible to wait for the future when the thread you
> called join() is also supposed to notify the future.  The only way to avoid
> this deadlock is to wait in another thread.

This is the same issue as DIRMINA-261.

Frederic Soulier <frederic@wallaby.uklinux.net>
OpenPGP key available on http://www.keyserver.net
1024D/BA6700ED   49A6 8E8E 4230 8D41 1ADE  B649 3203 1DD2 BA67 00ED

View raw message