Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-6387

ChannelToSessionMap/IdToConsumerMap array optimisation publishes in thread unsafe manner

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.18, 0.22, 0.30
    • Fix Version/s: 0.31
    • Component/s: JMS AMQP 0-x
    • Labels:
      None

      Description

      Two internal classes within the Java Client (ChannelToSessionMap / IdToConsumerMap) use an optimisation which hopes to permit 'fast access' first sixteen sessions (or consumers) by making use on an array. The array is written by one thread and then read by others. Unfortunately, the read/writes are not protected using a memory barrier so it is possible a thread may see a stale value, and this could lead to incorrect program behaviour.

      It is safer (and simpler) to replace the data structure with one backed by a ConcurrentHashMap.

        Attachments

          Activity

            People

            • Assignee:
              kwall Keith Wall
              Reporter:
              kwall Keith Wall
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: