Details

    • Similar Issues:
      Show 5 results 

      Description

      LockLocalServiceTest produces DB level unique constrain violation if two threads (or more than one node of a cluster) tries to acquire the same lock nearly at the same time.

      T1: Fetch lock           T2: Fetch lock
      T1: No data found
                               T2: No data found
      T1: Create new lock      
                               T2: Create new lock
      

      Steps to reproduce: Execute the pertinent test case (LockLocalServiceTest).

      $ git branch | grep "^*"
      * ee-6.1.20
      $ ant test-class -Dclass=LockLocalServiceTest
      ...
      [junit] 13:12:48,891 ERROR [pool-1-thread-3][JDBCExceptionReporter:76] Cannot insert duplicate key row in object 'dbo.Lock_' with unique index 'IX_DD635956'. The duplicate key value is (className, key, owner).
      [junit] 13:12:48,896 ERROR [pool-1-thread-6][JDBCExceptionReporter:76] Cannot insert duplicate key row in object 'dbo.Lock_' with unique index 'IX_DD635956'. The duplicate key value is (className, key, owner).
      ...
      [junit] Test com.liferay.portal.service.LockLocalServiceTest FAILED
      

      Unfortunately LockLocalService does not work well under the aforementioned race condition on trunk either and produces unique constraint violation on almost every RDBMS (except MySQL):

      • MySQL -> Deadlock
      • SQL Server -> Cannot insert duplicate key row in object 'dbo.Lock' with unique index 'IX_DD635956'._
      • DB2 -> SQL0803N
      • Oracle -> ORA-00001: unique constraint (LPORTAL_6200.IX_DD635956) violated.

        Issue Links

          Activity

          Hide
          Laszlo Csontos added a comment -

          This fix depends on LPS-30598.

          Show
          Laszlo Csontos added a comment - This fix depends on LPS-30598 .
          Hide
          Laszlo Csontos added a comment -

          According to the review LockLocalService works fine, however unit test LockLocalServiceTest lead me to wrong direction in terms of fixing the customer's issue.

          Show
          Laszlo Csontos added a comment - According to the review LockLocalService works fine, however unit test LockLocalServiceTest lead me to wrong direction in terms of fixing the customer's issue.

            People

            • Assignee:
              Laszlo Csontos
              Reporter:
              Laszlo Csontos
              Recent user:
              Esther Sanz
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 36 weeks, 1 day ago

                Development

                  Structure Helper Panel