[ 
https://issues.apache.org/jira/browse/AMQ-9820?focusedWorklogId=996716&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-996716
 ]

ASF GitHub Bot logged work on AMQ-9820:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Dec/25 14:56
            Start Date: 17/Dec/25 14:56
    Worklog Time Spent: 10m 
      Work Description: mattrpav commented on code in PR #1564:
URL: https://github.com/apache/activemq/pull/1564#discussion_r2627396759


##########
activemq-jms-pool/src/main/java/org/apache/activemq/jms/pool/PooledConnectionFactory.java:
##########
@@ -129,7 +129,12 @@ public void destroyObject(ConnectionKey connectionKey, 
PooledObject<ConnectionPo
                     @Override
                     public boolean validateObject(ConnectionKey connectionKey, 
PooledObject<ConnectionPool> pooledObject) {
                         ConnectionPool connection = pooledObject.getObject();
-                        if (connection != null && connection.expiredCheck()) {
+                        if (connection == null || connection.getConnection() 
== null) {

Review Comment:
   This looks like a good guard against the race condition





Issue Time Tracking
-------------------

    Worklog Id:     (was: 996716)
    Time Spent: 0.5h  (was: 20m)

> Closed connections leaked in the connection pool
> ------------------------------------------------
>
>                 Key: AMQ-9820
>                 URL: https://issues.apache.org/jira/browse/AMQ-9820
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: ConnectionPool
>            Reporter: Jean-Louis Monteiro
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When using reconnectOnException for the PooledConnectionFactory, it seems 
> that closed connections (on exception) remain in the pool due to wrong 
> validation rules



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to