Hi Trustin, The filter is the "tailFilter" that calls my IoHandler. My handler's exceptionCaught method closes the IoSession. In other words, I'm not closing the session from a user-defined filter.
I wanted to be sure I understood the issue correctly. I'll probably just remove the joins for now. Thanks, Steve > -----Original Message----- > From: Trustin Lee [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 21, 2006 4:33 PM > To: [email protected] > Subject: Re: Close future join behavior > > Hello Steve, > > On 9/21/06, Steve Bate <[EMAIL PROTECTED]> 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. > > HTH, > Trustin > -- > what we call human nature is actually human habit > -- > http://gleamynode.net/ > -- > PGP key fingerprints: > * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E > * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 >
