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

Make DefaultPermissionProvider thread-safe

    XMLWordPrintable

    Details

      Description

      DefaultPermissionProvider.getPermissionGroups is not thread-safe. This is visible in

      http://qa.nuxeo.org/jenkins/job/nuxeo-5.8/org.nuxeo.elasticsearch$nuxeo-elasticsearch-core/104/testReport/junit/junit/org.nuxeo.elasticsearch.test.nxql/TestCompareCoreWithES/testSimpleSearchWithSort/

      13:59:48,169 ERROR [ElasticSearchIndexingImpl] Fail to create indexing request for cmd: {"id":"IndexingCommand-01f7aadc-69e5-4bd0-a3c6-1031846af356","name":"ES_INSERT","docId":"e9f56a50-2646-4393-9f5b-055cad13fd58","path":"/folder/file3","repo":"test","recurse":false,"sync":false}
      org.nuxeo.ecm.core.api.ClientException: Unable to create index request for Document e9f56a50-2646-4393-9f5b-055cad13fd58
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.buildEsIndexingRequest(ElasticSearchIndexingImpl.java:293)
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.processIndexCommand(ElasticSearchIndexingImpl.java:206)
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.indexNow(ElasticSearchIndexingImpl.java:189)
      	at org.nuxeo.elasticsearch.ElasticSearchComponent.indexNow(ElasticSearchComponent.java:318)
      	at org.nuxeo.elasticsearch.work.IndexingWorker.doIndexingWork(IndexingWorker.java:61)
      	at org.nuxeo.elasticsearch.work.AbstractIndexingWorker.doWork(AbstractIndexingWorker.java:50)
      	at org.nuxeo.elasticsearch.work.BaseIndexingWorker.work(BaseIndexingWorker.java:49)
      	at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:68)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.util.ConcurrentModificationException
      	at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1115)
      	at java.util.TreeMap$KeyIterator.next(TreeMap.java:1169)
      	at java.util.AbstractCollection.toArray(AbstractCollection.java:195)
      	at org.nuxeo.ecm.core.security.DefaultPermissionProvider.getPermissionGroups(DefaultPermissionProvider.java:144)
      	at org.nuxeo.ecm.core.security.SecurityService.getPermissionsToCheck(SecurityService.java:174)
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.JsonESDocumentWriter.writeDoc(JsonESDocumentWriter.java:94)
      	at org.nuxeo.ecm.automation.jaxrs.io.documents.JsonESDocumentWriter.writeESDocument(JsonESDocumentWriter.java:150)
      	at org.nuxeo.elast
      

      this is in 5.8 may affect master as well (to be checked)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: