activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Myer (JIRA)" <j...@apache.org>
Subject [jira] Created: (AMQ-3118) Failover Transport Hot Backup Connections Not Being Closed By Connection Pool When The Primary Connection Is Idle
Date Wed, 05 Jan 2011 19:26:45 GMT
Failover Transport Hot Backup Connections Not Being Closed By Connection Pool When The Primary
Connection Is Idle
-----------------------------------------------------------------------------------------------------------------

                 Key: AMQ-3118
                 URL: https://issues.apache.org/jira/browse/AMQ-3118
             Project: ActiveMQ
          Issue Type: Bug
          Components: Connector
    Affects Versions: 5.3.2
         Environment: Centos 5.5
ActiveMQ 5.3.2 producer connecting to ActiveMQ 5.4.2 broker
            Reporter: Timothy Myer


I am currently using the following URL in my consumer to connect to my AMQ broker:
failover://(tcp://host1:61616,tcp://host2:61616)?randomize=false&maxReconnectAttempts=2&startupMaxReconnectAttempts=100&initialReconnectDelay=1000&backup=true&timeout=3000

I have specified the URL parameter backup=true to enable fast failover.

I am also using the following connection factory configuration from Spring:

<bean id="feeds-jms-connection-factory" class="org.apache.activemq.pool.XaPooledConnectionFactory"
  destroy-method="stop">
  <property name="connectionFactory">
    <bean class="org.apache.activemq.spring.ActiveMQConnectionFactory">
      <property name="brokerURL" value="failover://(tcp://host1:61616,tcp://host2:61616)?randomize=false&amp;maxReconnectAttempts=2&amp;startupMaxReconnectAttempts=100&amp;initialReconnectDelay=1000&amp;backup=true&amp;timeout=3000"
/>
      <property name="redeliveryPolicy">
        <bean class="org.apache.activemq.RedeliveryPolicy">
          <property name="maximumRedeliveries" value="3" />
          <property name="initialRedeliveryDelay" value="100" />
        </bean>
      </property>
    </bean>
  </property>
</bean>

The problem is this: currently, my producers are not working at a very high load, so my primary
connections are in an idle state for more than 30 seconds, which means that the connection
pool is expiring them.  Unfortunately, the pool is not closing the hot backup connections
(I can see this through either the JMX console or by running netstat on the producer and broker
boxes and seeing a large number of open connections between the producer and broker).  After
a few days, the broker is running out of file handles and the broker's CPU is pegged because
of all the persistent connections.

It seems that it should be the responsibility of the Pooled Connection Factory to close any
persistent backup connections (or perhaps it should be the responsibility of whichever component
creates the hot backup connection in the first place).  In any case, this seems to be a resource
leak.

My only option right now is not to use hot backups and to let those backup connections be
created dynamically.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message