ActiveMQ
  1. ActiveMQ
  2. AMQ-393

Stopping a PooledConnectionFactory leaves JmsSessionDispatcher threads running

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 4.0 M4
    • Component/s: JMS client
    • Labels:
      None

      Description

      When a PooledConnectionFactory is stopped, ObjectPools created by the SessionPools aren't closed, and therefore PooledSessions remain running. Since the underlying ActiveMQSession isn't actually closed when the PooledSession is closed, the ActiveMQSessionExecutor and its worker threads are never stopped. I added a method to PooledConnection called "destroyPools" which will close the ObjectPools associated with a connection. The differences are pasted below.

      diff oldpool/PooledConnection.java pool/PooledConnection.java
      21a22
      > import java.util.Iterator;
      154a156,163
      > protected void destroyPools() {
      > Iterator i = cache.values().iterator();
      > while (i.hasNext())

      { > SessionPool pool = (SessionPool) i.next(); > i.remove(); > pool.close(); > }

      > }
      diff oldpool/PooledConnectionFactory.java pool/PooledConnectionFactory.java
      95a96
      > connection.destroyPools();
      diff oldpool/SessionPool.java pool/SessionPool.java
      98c98,104
      <

      > protected void close() {
      > if (sessionPool != null) {
      > try

      { > sessionPool.close(); > }

      catch (Exception e) {}
      > }
      > }

        Activity

        Jeremy Volkman created issue -
        Hide
        james strachan added a comment -

        patch applied, thanks Jeremy

        Show
        james strachan added a comment - patch applied, thanks Jeremy
        james strachan made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 4.0 [ 11660 ]
        Hide
        beyond005 added a comment -

        I fix the files in ActiveMQ3.2 source code and rebuild it. But the problem still happen. The JmsSessionDispatcher threads increase to a big number and cause the test program hang. What's the problem?

        Show
        beyond005 added a comment - I fix the files in ActiveMQ3.2 source code and rebuild it. But the problem still happen. The JmsSessionDispatcher threads increase to a big number and cause the test program hang. What's the problem?
        beyond005 made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        james strachan added a comment -

        The issue is resolved in 4.0, not in 3.2

        Show
        james strachan added a comment - The issue is resolved in 4.0, not in 3.2
        james strachan made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Resolved [ 5 ]
        Hiram Chirino made changes -
        Fix Version/s 4.0 [ 11660 ]
        Fix Version/s 4.0 M4 [ 11726 ]
        Jeff Turner made changes -
        Project Import Fri Nov 26 22:32:02 EST 2010 [ 1290828722158 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Jeremy Volkman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development