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

"No Lock exists with the key {className=x, key=y}" messages appear in the logs when DLFileEntries are automatically removed from the trash

    Details

      Description

      Description
      The LockLocalServiceImpl#unlock does not work in an ideal way. It calls lockPersistence.removeByC_K and then catches a NoSuchLockException if the lock didn't exist. It would be better to call lockPersistence.fetchByC_K and then call lockPersistence.remove if this is not null for two reasons:

      1. We would avoid generating an exception in the case that the lock does not exist. See LPS-36174 for an explanation of why it is bad to generate exceptions unnecessarily.
      2. We would avoid logging messages from being printed in the case that the lock does not exist. In master and 7.0.x, these are DEBUG level messages, so it is unlikely that anyone will see them. However, in ee-6.2.x, these are WARN level messages, so it is likely that the administrators would see them if they are printed. These messages are confusing to the administrator and clog up the logs when there are many documents being deleted, so we should avoid printing them.

      Steps to Reproduce
      1. Add the following lines to portal-ext.properties:

      trash.entry.check.interval=1
      trash.entries.max.age=1
      

      2. Start up Liferay and log in as the admin user.
      3. If you are on ee-6.2.x or earlier, skip this step. Otherwise, navigate to Control Panel > Server Administration > Log Levels, and add a new log level of DEBUG for com.liferay.portal.lock.service.persistence.impl
      4. Navigate to Liferay Site > Content > Documents and Media, and add several documents.
      5. Move all the documents to the Recycle Bin.
      6. Wait until all the documents are automatically deleted from the Recycle Bin (it shouldn't take much more than a minute)

      Expected Result: No superfluous messages appear in the logs when the documents are deleted.
      Actual Result: A No Lock exists with the key {className=x, key=y} message appears in the logs for every document that was deleted.

        Attachments

          Activity

            People

            Assignee:
            hong.zhao Hong Zhao (Inactive)
            Reporter:
            michael.bowerman Michael Bowerman
            Participants of an Issue:
            Recent user:
            Csaba Turcsan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              4 years, 15 weeks, 5 days ago

                Packages

                Version Package
                7.0.0 DXP FP33
                7.0.0 DXP SP7
                7.0.5 CE GA6
                7.0.X
                7.1.X
                Master