ActiveMQ
  1. ActiveMQ
  2. AMQ-3680

Cleanup of temporary destinations by PooledConnection and ConnectionPool either leaks temp dests or deletes too many

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.6.0
    • Component/s: JMS client
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      Creating this as follow-up on AMQ-3457.

      AMQ-3457 removed cleanup on call to close() for PooledConnection objects, causing temporary destinations to remain in the broker until all uses of the actual underlying ActiveMQ connection are closed. Since those other uses of the underlying connection can be held indefinitely, or - on a very active system - there might be almost no time when there are no users of a connection, those temporary destinations essentially create a leak.

      The most correct operation would remove the temporary destination for each PooledConnection when it's close() method is called.

      Prior to AMQ-3457, updates for AMQ-2349 attempted to resolve this problem, but ended up being overly-aggressive, removing all of the temporary destinations from the underlying connection. So, one PooledConnection's close() deleted temporary destinations for multiple PooledConnection objects which were still active.

      Test case and patch will be provided.

      1. TestConnectionPoolTempCleanup.java
        8 kB
        Arthur Naseef
      2. pooledConnCleanupOwnTemps.patch
        8 kB
        Arthur Naseef

        Activity

        Arthur Naseef created issue -
        Hide
        Arthur Naseef added a comment -

        Patch which adds the correct cleanup on close() of PooledConnection.

        Show
        Arthur Naseef added a comment - Patch which adds the correct cleanup on close() of PooledConnection.
        Arthur Naseef made changes -
        Field Original Value New Value
        Attachment pooledConnCleanupOwnTemps.patch [ 12511767 ]
        Hide
        Arthur Naseef added a comment -

        JUnit that quickly demonstrates the issue.

        Includes code to test that a connection's temporary destinations are removed as well as another test that one connection doesn't remove the temp destinations of another.

        Show
        Arthur Naseef added a comment - JUnit that quickly demonstrates the issue. Includes code to test that a connection's temporary destinations are removed as well as another test that one connection doesn't remove the temp destinations of another.
        Arthur Naseef made changes -
        Attachment TestConnectionPoolTempCleanup.java [ 12511768 ]
        Hide
        Timothy Bish added a comment -

        Fix applied with a few mods and license header additions.

        Show
        Timothy Bish added a comment - Fix applied with a few mods and license header additions.
        Timothy Bish made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Timothy Bish [ tabish121 ]
        Fix Version/s 5.6.0 [ 12317974 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Timothy Bish
            Reporter:
            Arthur Naseef
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 2h
              2h
              Remaining:
              Remaining Estimate - 2h
              2h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development