Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-18881

org.jboss.as.connector.util.CopyOnWriteArrayListMultiMap is prone to ConcurrentModificationExceptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 33.0.0.Beta1, 33.0.0.Final
    • 30.0.0.Final
    • JCA
    • None

      A call to CopyOnWriteArrayListMultiMap.putIfAbsent(K, V) or remove(K, V) while another thread is iterating over the list returned via get(...), e.g. [1], will result in a ConcurrentModificationException. Additionally, it is unclear to me why any of the methods of this class are synchronized, since the underlying data structure is already thread safe (excluding the mapped list, which should probably use a CopyOnWriteArrayList or similar).

      [1] https://github.com/wildfly/wildfly/blob/main/connector/src/main/java/org/jboss/as/connector/deployers/ra/processors/RaXmlDependencyProcessor.java#L43

              tadamski@redhat.com Tomasz Adamski
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: