Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10756

Mina2 Producer "hang" until timeout if the response message could not be decoded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.18.1
    • 2.17.6, 2.18.3, 2.19.0
    • camel-mina2
    • None
    • Unknown

    Description

      I have tried to upgrade from camel 2.16 to 2.18 and run into an issue with camel-mina2. It looks like CAMEL-10024 has maybe introduced this issue.

      The scenario which fail:
      A Mina2 producer send a request to a server, the server provide a response which could not be interpreted/decoded by a custom codec on the producer side (e.g. due to invalid encoding).

      Expected behavior:

      • The Exception from the decoder on the producer side will be directly propogated to the caller. The mina2 session will be closed.

      Current behavior:

      • Instead of the exception from the decoder, the producer wait until the timeout is reached and the caller get a timeout exception after the timeout is reached.

      First analysis:
      I have attached a patch for the camel-mina2 module which contain a test org.apache.camel.component.mina2.Mina2CustomCodecTest.testProducerFailInDecodingResponse() to reproduce this issue.

      If i revert the changes done within CAMEL-10024, the test run correct. If I debug into the new code, i see that the producer "hang" in Mina2Producer.closeSessionIfNeededAndAwaitCloseInHandler(IoSession)closeLatch.await(timeout, TimeUnit.MILLISECONDS); which was introduced with CAML-10024.

      I could not yet provide a fix as well, since I don't really understand the details of CAMEL-10024. But hopefully my testcase helps to fix this issue.

      Attachments

        1. camel_mina2.patch
          5 kB
          Thomas Papke

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              thopap Thomas Papke
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: