Uploaded image for project: 'Spring AMQP'
  1. Spring AMQP
  2. AMQP-151

SingleConnectionFactory can close the wrong target connection on close

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.0.0.RC1
    • Fix Version/s: 1.0.0.RC2
    • Component/s: RabbitMQ
    • Labels:
      None

      Description

      SingleConnectionFactory can close the wrong target connection on close. From zzantozz on the forum:

      The targetConnection is created first, and then "connection" is targetConnection wrapped with an adapter. That's all well and good, but the adapter that the former connection is wrapped with is a SingleConnectionFactory.SharedConnectionProxy. The targetConnection is passed in as a constructor arg and is stored in the instance field SharedConnectionProxy.target. Then in SharedConnectionProxy.createChannel, it has the ability to detect that "target" is closed and to create a new connection. The problem here is that it only updates SharedConnectionProxy.target and not SingleConnectionFactory.targetConnection, so when the factory is shut down, it will try to close a connection that is already known to be bad, and the good connection won't be closed. Given that SharedConnectionProxy is an inner class of SingleConnectionFactory, the correct behavior could be gotten just by eliminating the target field from the former and directly accessing targetConnection in the latter.

        Attachments

          Activity

            People

            Assignee:
            david_syer Dave Syer
            Reporter:
            david_syer Dave Syer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: