Qpid
  1. Qpid
  2. QPID-4782

[Java Broker] ConnectionAdapter.getSessions() can cause a ConcurrentModificationException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.20
    • Fix Version/s: 0.22
    • Component/s: Java Broker
    • Labels:
      None

      Description

      Changes made via QPID-4760 exposed a defect in ConnectionAdapter.getSessions() which can cause a ConcurrentModificationException. This is due to unsafe use of map.remove() whilst iterating the map keyset. The code will be change to use an Iterator and call iterator.remove instead.

      Recent test failure stacktrace showing the issue:

      IoReceiver - /127.0.0.1:60051 2013-04-26 15:25:31,050 ERROR [qpid.server.transport.ServerSessionDelegate] Exception processing command
      java.util.ConcurrentModificationException
      	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:806)
      	at java.util.HashMap$KeyIterator.next(HashMap.java:841)
      	at org.apache.qpid.server.model.adapter.ConnectionAdapter.getSessions(ConnectionAdapter.java:67)
      	at org.apache.qpid.server.model.adapter.ConnectionAdapter.getSessionAdapter(ConnectionAdapter.java:97)
      	at org.apache.qpid.server.model.adapter.QueueAdapter.getSessionAdapter(QueueAdapter.java:118)
      	at org.apache.qpid.server.model.adapter.QueueAdapter.subscriptionRegistered(QueueAdapter.java:616)
      	at org.apache.qpid.server.queue.SimpleAMQQueue.registerSubscription(SimpleAMQQueue.java:447)
      	at org.apache.qpid.server.transport.ServerSessionDelegate.messageSubscribe(ServerSessionDelegate.java:266)
      	at org.apache.qpid.server.transport.ServerSessionDelegate.messageSubscribe(ServerSessionDelegate.java:73)
      

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        4m 44s 1 Robbie Gemmell 27/Apr/13 15:16
        In Progress In Progress Resolved Resolved
        2d 21h 18m 1 Robbie Gemmell 30/Apr/13 12:34
        Resolved Resolved Closed Closed
        652d 8h 32m 1 Rob Godfrey 11/Feb/15 20:07
        Rob Godfrey made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Robbie Gemmell made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Robbie Gemmell added a comment -

        r1476583 merged to the 0.22 release branch via: http://svn.apache.org/r1477567

        Show
        Robbie Gemmell added a comment - r1476583 merged to the 0.22 release branch via: http://svn.apache.org/r1477567
        Hide
        Robbie Gemmell added a comment -
        Show
        Robbie Gemmell added a comment - Fix made via http://svn.apache.org/r1476583
        Robbie Gemmell made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Robbie Gemmell created issue -

          People

          • Assignee:
            Robbie Gemmell
            Reporter:
            Robbie Gemmell
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development