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

Portal cache manager may not ready when received a notification from cluster

    Details

      Description

      Steps to Reproduce:

      1. Prepare a Liferay Cluster with 2 nodes (nodeA + nodeB)
      2. Start nodeA
        1. Navigate to Control Panel > Server Administration > Script
        2. Run the following script:
          import com.liferay.portal.kernel.service.UserLocalServiceUtil
          import com.liferay.portal.kernel.util.PortalUtil
          
          userId = PortalUtil.getUserId(actionRequest);
          
          (1..100).each {
              UserLocalServiceUtil.updateAgreedToTermsOfUse(userId, true)
              sleep 500
          }
          
      3. Start nodeB
      4. Observe logs in nodeB

      Expected Result:
      No errors are thrown

      Actual Result:
      IllegalStateExceptions are thrown

      Sample stacktrace:

      2020-11-16 21:38:03.185 ERROR [liferay/cache_replication-1][ParallelDestination:59] Unable to process message {destinationName=liferay/cache_replication, response=null, responseDestinationName=null, responseId=null, payload=[[email protected], values={companyId=0, clusterInvoke=false, groupId=0}}
      com.liferay.portal.kernel.messaging.MessageListenerException: java.lang.IllegalStateException: Unable to get portal cache manager MULTI_VM_PORTAL_CACHE_MANAGER
          at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
          at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
          at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:56)
          at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:752)
          at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.IllegalStateException: Unable to get portal cache manager MULTI_VM_PORTAL_CACHE_MANAGER
          at com.liferay.portal.cache.multiple.internal.PortalCacheManagerUtil.getPortalCacheManager(PortalCacheManagerUtil.java:51)
          at com.liferay.portal.cache.multiple.internal.cluster.link.messaging.ClusterLinkPortalCacheClusterListener.handlePortalCacheClusterEvent(ClusterLinkPortalCacheClusterListener.java:69)
          at com.liferay.portal.cache.multiple.internal.cluster.link.messaging.ClusterLinkPortalCacheClusterListener.doReceive(ClusterLinkPortalCacheClusterListener.java:62)
          at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      

        Attachments

          Activity

            People

            Assignee:
            summer.zhang Summer Zhang
            Reporter:
            tina.tian Tina Tian
            Participants of an Issue:
            Recent user:
            Clarissa Velazquez
            Engineering Assignee:
            Tina Tian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              33 weeks, 5 days ago

                Packages

                Version Package
                7.2.10 DXP FP12
                7.2.X
                7.3.10 DXP FP1
                7.3.10.1 DXP SP1
                7.3.6 CE GA7
                7.3.X
                Master