You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2017/05/23 15:40:04 UTC

[jira] [Commented] (AMQ-6612) PooledConnectionFactory's expired connections are still assignable for new session.

    [ https://issues.apache.org/jira/browse/AMQ-6612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16021351#comment-16021351 ] 

Timothy Bish commented on AMQ-6612:
-----------------------------------

The issue here is that there are still references to the expired connection and so not handing them out implies that you allow the pool of active connections to grow beyond the configured max connections in order to have the ability to create a new connection to service the request when the connections in the pool have reached their expiration value but are still in use.  

> PooledConnectionFactory's expired connections are still assignable for new session.
> -----------------------------------------------------------------------------------
>
>                 Key: AMQ-6612
>                 URL: https://issues.apache.org/jira/browse/AMQ-6612
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.11.0
>            Reporter: Raphiki
>
> Since a couple of week we tried to tune our JMS connections established from Apache Camel to ActiveMQ.
> We're using *org.apache.activemq.pool.PooledConnectionFactory* as ConnectionFactory and the *expiryTimeout* parameter does not work as expected. On my testing environment I've 30 consumer on 15 connection and 200 maximumActiveSessionPerConnection set. The problem is that I rarely see any reconnection (I use a HAProxy to log TCP reconnection). Furthermore these rarely reconnection appends much more after the expiryTimeout I configure (10, 100 times more) and when I restart my server I can observe some connections which have never been released.
> However if I define 1 or less connection per consumer I observe expected reconnection, but I don't think it makes any sense with sharing connection pattern...
> I explore activemq-jms-pool's code and found that the [connectionPool.borrow() method|http://grepcode.com/file/repo1.maven.org/maven2/org.apache.activemq/activemq-jms-pool/5.11.0/org/apache/activemq/jms/pool/PooledConnectionFactory.java#236] just call the expiryCheck() throught the [validateObject()|http://grepcode.com/file/repo1.maven.org/maven2/org.apache.activemq/activemq-jms-pool/5.11.0/org/apache/activemq/jms/pool/PooledConnectionFactory.java#135] method but it considers the connection valid (and so reusable) if it has expired but has still some remaining reference...
> So I think the problem's explanation is that my connection is continually in use, so even if it is expired the connection is considered as valid and is reusable, and is assigned for new session and stay continually in use and so one...
> Should these expired connections not be borrowed anymore when expired ? (but do not destroy them otherwise you will repoen AMQ-4366!).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)