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

Mina Server is losing messages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.4
    • 2.2.0
    • Core
    • None
    • Mina Sprint 2.2.0

    Description

      During our tests we found that in some circumstances Mina server loses messages.

      From what we understand this happens when client opens connection and then sends message(s) and the server is still busy processing the sessionOpened event while the message the client sent went through the server’s filterChain.

       

      Attached is a simple client and server that will help you reproduce the problem, before you run it please perform the following steps:

      Configuration:

      1. In order to reproduce the problem SSL filter must be defined (already implemented in the attached example)
      2. Update the keystore and truststore files locations in addSSLFilter() method in MinaClient and MinaServer
      3. Set server break points at:
      4. MinaServerHandler#sessionOpened
      5. MinaServerHandler#messageReceived
      6. org.apache.mina.core.filterchain.IoFilter.NextFilter#messageReceived
      1. Set client break points at:
      2. MinaClientHandler#sessionOpened

       

      Since this is a timing problem you need to run a debugger as described below:

      1. Start server
      2. Start client
      3. At the client at MinaClientHandler#sessionOpened release the break point
      4. Release all break points except server’s  MinaServerHandler#sessionOpened
      5. After org.apache.mina.core.filterchain.IoFilter.NextFilter#messageReceived completed to process all events, you can release MinaServerHandler#sessionOpened

                       

      Expected result:

      MinaServerHandler#messageReceived will be invoked with the message sent by the client

      Actual result:

      MinaServerHandler#messageReceived is not invoked.

       

      To use the example, add the following jars to your class path:
      commons-lang3-3.9.jar
      log4j-api-2.13.3.jar
      log4j-core-2.13.3.jar
      log4j-jcl-2.13.3.jar
      mina-core-2.1.4.jar
      slf4j-api-1.7.26.jar
      spring-jcl-5.2.12.RELEASE.jar

       

      The java we use is AdoptJDK 11.0.8

      Attachments

        1. mina-core-2.2.0-SNAPSHOT.jar
          678 kB
          Jonathan Valliere
        2. mina-core-2.1.5-SNAPSHOT-working.jar
          666 kB
          Eliran
        3. mina-core-2.1.5-SNAPSHOT-ssl2.jar
          666 kB
          Eliran
        4. mina_client_server.zip
          120 kB
          Guy Itzhaki
        5. DIRMINA-1145-EXAMPLE.zip
          251 kB
          Jonathan Valliere

        Issue Links

          Activity

            People

              johnnyv Jonathan Valliere
              guyi Guy Itzhaki
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: