Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-72769

Importing a large LAR will throw a ConcurrentModificationException when processing indexer requests

    Details

      Description

      The IndexerRequestBuffer class is not synchronized so indexer requests can be added after the map has been returned, causing a ConcurrentModificationException:

      19:06:10,103 ERROR [liferay/background_task-1][SearchPermissionCheckerImpl:161] java.util.ConcurrentModificationException
      java.util.ConcurrentModificationException
      	at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:719)
      	at java.util.LinkedHashMap$LinkedValueIterator.next(LinkedHashMap.java:747)
      	at com.liferay.portal.search.internal.buffer.DefaultIndexerRequestBufferExecutor.execute(DefaultIndexerRequestBufferExecutor.java:61)
      	at com.liferay.portal.search.internal.buffer.DefaultIndexerRequestBufferOverflowHandler.bufferOverflowed(DefaultIndexerRequestBufferOverflowHandler.java:71)
      	at com.liferay.portal.search.buffer.IndexerRequestBuffer.add(IndexerRequestBuffer.java:84)
      	at com.liferay.portal.search.internal.buffer.IndexerRequestBufferHandler.bufferRequest(IndexerRequestBufferHandler.java:44)
      	at com.liferay.portal.search.internal.buffer.BufferedIndexerInvocationHandler.doBufferRequest(BufferedIndexerInvocationHandler.java:231)
      	at com.liferay.portal.search.internal.buffer.BufferedIndexerInvocationHandler.bufferRequest(BufferedIndexerInvocationHandler.java:218)
      	at com.liferay.portal.search.internal.buffer.BufferedIndexerInvocationHandler.invoke(BufferedIndexerInvocationHandler.java:154)
      	at com.sun.proxy.$Proxy505.reindex(Unknown Source)
      	at com.liferay.portal.search.internal.SearchPermissionCheckerImpl.doUpdatePermissionFields(SearchPermissionCheckerImpl.java:387)
      	at com.liferay.portal.search.internal.SearchPermissionCheckerImpl.updatePermissionFields(SearchPermissionCheckerImpl.java:158)
      	at com.liferay.portal.search.internal.IndexWriterHelperImpl.updatePermissionFields(IndexWriterHelperImpl.java:608)
      	at com.liferay.portal.kernel.search.IndexWriterHelperUtil.updatePermissionFields(IndexWriterHelperUtil.java:247)
      	at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addModelResources(ResourceLocalServiceImpl.java:848)
      	at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addModelResources(ResourceLocalServiceImpl.java:861)
      	at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addModelResources(ResourceLocalServiceImpl.java:221)
      	at sun.reflect.GeneratedMethodAccessor1922.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
      	at com.sun.proxy.$Proxy63.addModelResources(Unknown Source)
      	at com.liferay.journal.service.impl.JournalArticleLocalServiceImpl.addArticleResources(JournalArticleLocalServiceImpl.java:593)
      	at com.liferay.journal.service.impl.JournalArticleLocalServiceImpl.addArticle(JournalArticleLocalServiceImpl.java:448)
      	at sun.reflect.GeneratedMethodAccessor1913.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:51)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
      	at com.sun.proxy.$Proxy488.addArticle(Unknown Source)
      	at com.liferay.journal.exportimport.data.handler.JournalArticleStagedModelDataHandler.doImportStagedModel(JournalArticleStagedModelDataHandler.java:709)
      	at com.liferay.journal.exportimport.data.handler.JournalArticleStagedModelDataHandler.doImportStagedModel(JournalArticleStagedModelDataHandler.java:79)
      	at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:364)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:369)
      	at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:355)
      	at com.liferay.journal.exportimport.data.handler.JournalPortletDataHandler.doImportData(JournalPortletDataHandler.java:339)
      	at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:382)
      	at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:290)
      	at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:826)
      	at com.liferay.exportimport.controller.LayoutImportController.doImportFile(LayoutImportController.java:822)
      	at com.liferay.exportimport.controller.LayoutImportController.importFile(LayoutImportController.java:224)
      	at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importLayouts(ExportImportLocalServiceImpl.java:185)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
      	at com.sun.proxy.$Proxy92.importLayouts(Unknown Source)
      	at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importLayouts(ExportImportLocalServiceUtil.java:202)
      	at com.liferay.exportimport.background.task.LayoutImportBackgroundTaskExecutor$LayoutImportCallable.call(LayoutImportBackgroundTaskExecutor.java:123)
      	at com.liferay.exportimport.background.task.LayoutImportBackgroundTaskExecutor$LayoutImportCallable.call(LayoutImportBackgroundTaskExecutor.java:109)
      	at com.liferay.portal.spring.transaction.TransactionInvokerImpl$CallableMethodInvocation.proceed(TransactionInvokerImpl.java:101)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
      	at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:47)
      	at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28)
      	at com.liferay.exportimport.background.task.LayoutImportBackgroundTaskExecutor.execute(LayoutImportBackgroundTaskExecutor.java:84)
      	at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:54)
      	at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:43)
      	at com.liferay.portal.kernel.backgroundtask.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:56)
      	at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:124)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
      	at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Activity

            People

            • Assignee:
              raven.song Raven Song
              Reporter:
              jonathan.mccann Jonathan McCann
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 20 weeks ago

                Packages

                Version Package
                7.0.0 DXP FP19
                7.0.3 CE GA4
                7.0.0 DXP SP4
                7.0.X EE
                7.1.X
                Master