ActiveMQ
  1. ActiveMQ
  2. AMQ-1484

PooledConnection.close() doesn't always close the ActiveMQConnection

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Not A Problem
    • Affects Version/s: 5.0.0
    • Fix Version/s: AGING_TO_DIE
    • Component/s: Broker
    • Labels:
      None

      Description

      using snapshot apache-activemq-5.0-20071028.173739-45

      if you call org.apache.activemq.pool.PooledConnection.close(), it calls ConnectionPool.decrementReferenceCount()

      this updates the lastUsed time and decrements the ref count, which if its now zero, calls expiredCheck();

      in this case, ConnectionPool.expiredCheck() will only close the connection if hasFailed or hasExpired is true (it won't close based on idle time because you've just updated lastUsed)

      which means that in a lot of cases it won't actually close the connection. if you are shutting down the JVM, the connection must be closed otherwise there will be a non-daemon thread still waiting around which will prevent everything from shutting down cleanly.

      to fix, i think if ref count is zero, then it should always close().

        Activity

        Jeff Turner made changes -
        Project Import Fri Nov 26 22:32:02 EST 2010 [ 1290828722158 ]
        Gary Tully made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Not A Problem [ 6 ]
        Bruce Snyder made changes -
        Fix Version/s 5.4.0 [ 12110 ]
        Fix Version/s AGING_TO_DIE [ 12187 ]
        Gary Tully made changes -
        Fix Version/s 5.4.0 [ 12110 ]
        Fix Version/s 5.3.0 [ 11914 ]
        Rob Davies made changes -
        Field Original Value New Value
        Fix Version/s 5.3.0 [ 11914 ]
        Alex Burgel created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Alex Burgel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development