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

Possible database deadlock when calling concurrently from persistence layer nestedSetsTreeManager

    Details

      Description

      PersistenceNestedSetsTreeManager.doUpdate performs bulk updates that in a highly concurrent environment can block the database throwing exceptions like the following one, depending on the database locking mechanism:

      com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.LockAcquisitionException: could not execute native bulk manipulation query
      	at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:446)
      	at com.liferay.portal.kernel.service.persistence.impl.PersistenceNestedSetsTreeManager.doUpdate(PersistenceNestedSetsTreeManager.java:392)
      	at com.liferay.portal.kernel.service.persistence.impl.NestedSetsTreeManager.insert(NestedSetsTreeManager.java:75)
      	at com.liferay.portlet.asset.service.persistence.impl.AssetCategoryPersistenceImpl.updateImpl(AssetCategoryPersistenceImpl.java:12379)
      	at com.liferay.portlet.asset.service.persistence.impl.AssetCategoryPersistenceImpl.updateImpl(AssetCategoryPersistenceImpl.java:78)
      	at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:544)
      

       

       Attached can be found the deadlock report including a couple of concurrent bulk updates: xml_deadlock_report.xml

       

      Steps to Reproduce (7.2.x):

      1. Execute the attached script assetCategoryConcurrency.groovy

       

      Expected Results:

      The script should finish without exception in the logs.

       

      Actual Results:

      The script prints several ORMException in the logs.

       

      Master doesn't provide OOTB any hierarchical tree entity.

       

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            mariano.alvaro Mariano Álvaro
            Participants of an Issue:
            Recent user:
            Mariano Álvaro
            Engineering Assignee:
            Mariano Álvaro
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              44 weeks, 3 days ago

                Packages

                Version Package