Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-1077

Threads hanging in dispose() on SSLHandshakeException



    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.16
    • 2.0.17
    • None
    • None
    • JDK 1.8.0_162-b12
      Xubuntu 16.04. Kernel 4.4.0-112-generic
      Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz


      This is probably related to DIRMINA-1076.

      See attached unit test SslTestHandshakeException. For the test to run you also need the attached file emptykeystore.sslTest placed into mina-core/src/test/resources/org/apache/mina/filter/ssl/. The purpose of the test is simply to provoke an SSLHandshakeException. I have seen the problematic behaviour once in a while on processes implemented with QuickFIX/J but now luckily got it reproduced in a unit test.

      When I run it against MINA-2.0.17-SNAPSHOT I will get (almost instantly) the stack trace as in mina-dispose-hang-2.0.17-SNAPSHOT.txt and the test will hang.

      When ran against MINA-2.0.17-SNAPSHOT plus the patch from DIRMINA-1076 I will get the stack trace from attached file mina-dispose-hang-with-DIRMINA-1076-patch.txt and additionally the following log output (but the test will still hang):

      XXX javax.net.ssl.SSLHandshakeException: SSL handshake failed.
      Exception in thread "pool-337-thread-1" java.lang.AssertionError: Internal Session Count is Negative
      	at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:674)
      	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:748)

      In both attached stack traces the process is hanging in a call to dispose() although one time it is in the NioSocketConnector and in the other case in the NioSocketAcceptor.


        1. emptykeystore.sslTest
          0.0 kB
          Christoph John
        2. mina-dispose-hang-2.0.17-SNAPSHOT.txt
          12 kB
          Christoph John
        3. mina-dispose-hang-with-DIRMINA-1076-patch.txt
          9 kB
          Christoph John
        4. SslTestHandshakeException.java
          6 kB
          Christoph John

        Issue Links



              johnnyv Jonathan Valliere
              chrjohn Christoph John
              0 Vote for this issue
              2 Start watching this issue