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 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 ?
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)
The weird thing is that the behaviour is unpredictable.
When you run the test several times, most often the call to dispose is done
by NioProcessor-6, but sometimes it's done by the "main" thread !?
(it's always run by main when  you uncomment the call to Thread.sleep)

The following questions remain :
* should we support calling connector.dispose from the closeFuture callback
?  I don't think so.
* If we don't support it, should we try to detect it, and log a warning
about is ? I don't think so.

Trying to detect if people are shooting themselves in the foot is not easy
in this case (or at least not elegant).

Sure !

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

Reply via email to