Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-393

Stopping a PooledConnectionFactory leaves JmsSessionDispatcher threads running

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.2
    • 4.0 M4
    • JMS client
    • 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) {}
      > }
      > }

      Attachments

        Activity

          People

            Unassigned Unassigned
            jvolkman Jeremy Volkman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: