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

temp destinations should only be deleted once all users of a pooled connection call close

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.x
    • 5.6.0
    • None
    • None
    • 5.6-SNAPSHOT

    • Patch Available

    Description

      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.

      Attachments

        1. amqpool.diff
          3 kB
          Jonathan Anstey
        2. pooledConnCleanupOwnTemps.patch
          7 kB
          Arthur Naseef
        3. PooledSessionTempDestEventListener.java
          0.5 kB
          Arthur Naseef
        4. TestConnectionPoolLingeringTemps.java
          6 kB
          Arthur Naseef
        5. TestConnectionPoolTempCleanup.java
          8 kB
          Arthur Naseef

        Activity

          People

            janstey Jonathan Anstey
            janstey Jonathan Anstey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: