ActiveMQ
  1. ActiveMQ
  2. AMQ-2088

Change the InactivityMonitor to clear its flag as soon as a few bytes are received on a connection rather than only after an entire message has been assembled.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 5.1.0
    • Fix Version/s: 5.3.0
    • Component/s: Transport
    • Labels:
      None

      Description

      On slow connections with larger messages to be exchanged, the inactivity monitor might kick in, drop the network connection and re-establish it again. This prevents two brokers from exchanging larger messages on a slow connection as the transmission always gets interrupted.
      See the discussion of this on http://activemq.apache.org/slow-networks-drop-large-messages.html.
      The problem is that the InactivityMonitor always waits for a complete message to be assembled on an active connection before clearing its internal flag.

      I propose to change the behavior of the InactivityMonitor so that it clears its flag already when a few bytes were received on a network connection rather than waiting for the entire message to be sent. This should work around the problem of connections being dropped and re-established periodically when receiving large messages.

        Issue Links

          Activity

          Hide
          Hiram Chirino added a comment -

          opened
          AMQ-2511 to track

          Show
          Hiram Chirino added a comment - opened AMQ-2511 to track
          Hide
          Hiram Chirino added a comment -

          I think a better approach would be for the wireformat to expose a counter which is incremented as data is read.

          That way between inactivity check intervals the inactivity monitor can check to see if that value has changed since it's last check.

          Show
          Hiram Chirino added a comment - I think a better approach would be for the wireformat to expose a counter which is incremented as data is read. That way between inactivity check intervals the inactivity monitor can check to see if that value has changed since it's last check.
          Hide
          Hiram Chirino added a comment -

          This fix caused a regression on in the inactivity monitor.

          Now when a socket is waiting to read the next message, or is in the middle of receiving the next message it sets a flag that disable the inactivity monitor from timing out the connection. The problem is that if the connection gets hung, then it won't time out since the flag is set.

          Show
          Hiram Chirino added a comment - This fix caused a regression on in the inactivity monitor. Now when a socket is waiting to read the next message, or is in the middle of receiving the next message it sets a flag that disable the inactivity monitor from timing out the connection. The problem is that if the connection gets hung, then it won't time out since the flag is set.
          Hide
          Dejan Bosanac added a comment -

          Fixed in SVN revision 742458. Thanks to Vedran Vrbanc for initial fix patch.

          Show
          Dejan Bosanac added a comment - Fixed in SVN revision 742458. Thanks to Vedran Vrbanc for initial fix patch.

            People

            • Assignee:
              Dejan Bosanac
              Reporter:
              Torsten Mielke
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development