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

Opening an organization's template-based private pages for the first time takes too long, if the corresponding portal instance contains high number of roles.

    Details

      Description

      Opening an organization's template-based private pages for the first time takes too long, if the corresponding portal instance contains high number of roles.

      1) Create ~5K organizations with at least 3 teams for each
      2) Log in with test@liferay.com
      3) Navigate to Control Panel
      4) Create a page template t1 and drop 10 arbitrary portlets of of your choice to it
      5) Choose a random organization, let's call it o1
      6) Click Actions/Edit and Organization Site thereafter
      7) Tick Create Site and click Save
      8) Under Sites select the site of o1 and from Actions click on Site Administration
      9) Create a private page p1 based on t1, enable Automatically apply changes done to the page template
      10) Click Add Page

      Phenonmenon #1: Creation of p1 takes from ~30sec to several minutes.
      Phenonmenon #2: Apply any change to t1 (eg. adjust permissions on one of the portlets) and refresh p1. After that p1 needs considerable time to be rendered.

      Analysis: If you take a thread dump, you can see the following. Propagation of changes initiated by LayoutLocalServiceVirtualLayoutsAdvice is taking place, but the process spend vast amount of time inside sites.util.SitesUtil.copyPortletPermissions().

      "http-bio-8080-exec-7" daemon prio=10 tid=0x00007f92c4066800 nid=0x7897 runnable [0x00007f929b0e5000]
      java.lang.Thread.State: RUNNABLE
      ...
      at com.liferay.portal.service.persistence.ResourcePermissionPersistenceImpl.findByC_N_S_P_R(ResourcePermissionPersistenceImpl.java:4511)
      at com.liferay.portal.service.persistence.ResourcePermissionPersistenceImpl.findByC_N_S_P_R(ResourcePermissionPersistenceImpl.java:4354)
      at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at com.liferay.portal.security.lang.DoPrivilegedHandler.doInvoke(DoPrivilegedHandler.java:88)
      at com.liferay.portal.security.lang.DoPrivilegedHandler.invoke(DoPrivilegedHandler.java:56)
      at com.sun.proxy.$Proxy355.findByC_N_S_P_R(Unknown Source)
      at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.doUpdateResourcePermission(ResourcePermissionLocalServiceImpl.java:1143)
      at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.updateResourcePermission(ResourcePermissionLocalServiceImpl.java:1298)
      at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.setResourcePermissions(ResourcePermissionLocalServiceImpl.java:1086)
      ...
      at com.liferay.portal.service.ResourcePermissionLocalServiceUtil.setResourcePermissions(ResourcePermissionLocalServiceUtil.java:906)
      at com.liferay.portlet.sites.util.SitesUtil.copyPortletPermissions(SitesUtil.java:329)
      at com.liferay.portlet.sites.util.SitesUtil.applyLayoutPrototype(SitesUtil.java:221)
      at com.liferay.portlet.sites.util.SitesUtil.doMergeLayoutPrototypeLayout(SitesUtil.java:1245)
      at com.liferay.portlet.sites.util.SitesUtil.mergeLayoutPrototypeLayout(SitesUtil.java:894)
      at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:98)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 12 weeks, 5 days ago

                  Packages

                  Version Package
                  6.1.X EE
                  6.2.0 CE RC2