You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Jonathan Anstey (Reopened) (JIRA)" <ji...@apache.org> on 2011/10/05 19:15:34 UTC

[jira] [Reopened] (AMQ-3457) temp destinations should only be deleted once all users of a pooled connection call close

     [ https://issues.apache.org/jira/browse/AMQ-3457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Anstey reopened AMQ-3457:
----------------------------------

      Assignee: Jonathan Anstey  (was: Timothy Bish)

Found another issue with this... so in the original bug multiple clients were using the same pooled connection and if one of those clients called close, it could potentially delete another client's temporary destination since they all shared the same connection. The fix was to wait until all clients had called close before deleting the temp destination.

Now, in the case where there is a large pool of connections available, every client gets their own connection so the previous issue isn't a problem anymore. However, the AdvisoryConsumer holds on to a copy of all temp destinations and also adds each of these temp destinations to the connection it uses. So now, 2 connections have a reference to the same temp destination... which is a problem. If this connection is also used by a client and the client calls close, then the temp destinations will be deleted even though they are still used by another connection. 

Will commit a fix shortly for this.
                
> temp destinations should only be deleted once all users of a pooled connection call close
> -----------------------------------------------------------------------------------------
>
>                 Key: AMQ-3457
>                 URL: https://issues.apache.org/jira/browse/AMQ-3457
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.x
>         Environment: 5.6-SNAPSHOT
>            Reporter: Jonathan Anstey
>            Assignee: Jonathan Anstey
>             Fix For: 5.6.0
>
>         Attachments: amqpool.diff
>
>
> AMQ-2349 added some code to clean up temp destinations once close() is called on a pooled connection. This caused pretty much all the JMS request-reply tests to fail in Camel with "javax.jms.InvalidDestinationException: Cannot publish to a deleted Destination" :) 
> The problem is that with a pooled connection, multiple users can be using a Connection at the same time (a reference count is kept of how many there are) so if once calls close() the temp destinations of several others could be deleted while they are still using them. I think the correct behavior would be to only delete the temp destinations when all connection users call close() (i.e. when the reference count becomes zero).
> Attaching a proposed fix for this shortly for review.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira