Hi,

On Mon, Sep 13, 2010 at 11:30 AM, Emmanuel Lécharny<elecha...@apache.org>wrote:

  Hi,
Now that 2.0. is coming so close, I tried to get a cleaner fix for the
MdcInjectionFilterTest that used to be failing.
Sorry that I didn't get to it sooner.

The problem lies not so much in that test-case.
IMO, the problem is basically that since revision=900163 [1] we no longer
have an API to block until an AbstractIoService is completely disposed.
I am afraid that we have a lot of test-cases that leave threads behind,
when
finished.

The problem with the way people were using dispose was wrong : calling
dispose() in a listener was a garante for a deadlock, as the wait was done
in the same thread.

I agree.
But IIUC, revision 900163 tried to make it possible to call dispose from a
listener ?
That was the reason to remove the call to executor.awaitTermination, no ?
In fact, AFAIR, we just get out as we don't wait.


  I have just added an overloaded dispose method :  public final void
dispose(boolean awaitTermination) that resurrects the previous behaviour.
To be safe I didn't change the default behaviour : dispose() =
dispose(false) = do not wait for termination.
Out of curiosity, I ran all tests with dispose() = dispose(true) and they
all passed.

Can you post the code you have added ?

http://svn.apache.org/viewvc?view=revision&revision=996337
Ok, updated and tested ocally. Pass tests with flying colors.

  I also added the attachment for DIRMINA-755 as a test-case.
Note that you should run the main-method instead of the test-case :
running
the test-case from my IDE (Intellij IDEA) just resulted in "All Tests
Passed" instead of blocking until all threads finish.

Can you attach the test in DIRMINA-755 (re-open the issue until we apply
the patch)

Not sure what you mean ?  I already committed my changes and the test-case
in trunk :

http://svn.apache.org/viewvc/mina/trunk/mina-core/src/test/java/org/apache/mina/core/service/AbstractIoServiceTest.java?view=markup&pathrev=996337

I was confused with your first comment. I saw the commit and svn up my env. All is ok.
Let me know what you think.
By the way, the hudson build failed on windows, but it works for me under
linux and Win XP.
I am afraid we have (at least one) unstable test-case.
Not 100% sure. It may stablized whe the tests will be run a second time.


--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Reply via email to