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

Enrich with REST+netty hangs when connection is closed without response

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.5, 3.7.2
    • Fix Version/s: 3.7.3, 3.9.0
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Enricher hangs when used with REST endpoint utilizing netty when there is no response from the server but the server immediately closes the connection. In such case read timeout is ignored as connection is already closed.
       
      The reason of this behavior is that org.apache.camel.component.netty.handlers.ClientChannelHandler.channelInactive contains following conditions for callback invocation when there was no response:

      configuration.isSync() && !doneUoW && !messageReceived && !exceptionHandled
      

      where

      doneUoW = exchange.getUnitOfWork() == null
      

      It works as expected when initially there had been UoW in Exchange (this is the case when using to). However, enricher by default (and by design) clears UoW for exchange it creates and this breaks above check.

      Setting shareUnitOfWork for enrich works around the problem.

        Attachments

        1. EnrichWithoutRestResponseTest.java
          3 kB
          Krzysztof Jamróz

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                krzysztofjamroz Krzysztof Jamróz
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: