Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-32211

Fix possible ConcurrentModificationException in DocumentValidation service

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2023.7, 2021.49
    • Component/s: Core

      Description

      Seen in production:

      java.util.ConcurrentModificationException: null
      	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1511) ~[?:?]
      	at java.util.HashMap$ValueIterator.next(HashMap.java:1539) ~[?:?]
      	at org.nuxeo.ecm.core.api.validation.DocumentValidationServiceImpl.validate(DocumentValidationServiceImpl.java:122) ~[nuxeo-core-api-2021.45.8.jar:?]
      	at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1744) ~[nuxeo-core-2021.45.8.jar:?]
      	at 
      

      This means that we are modifying the data models values in the loop,
      using an iterator will allow item removal but we don't know which kind of update is done on the list.

         for (DataModel dataModel : document.getDataModels().values()) {
            // code is updating the document.getDataModels() generating the exception on the next value
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: