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

TemplatePortletPreferences isn't thread-safe

    Details

      Description

      Scenario

      There are multiple portlets embedded to difference pages by using layout templates. In this example Asset Publisher and Search portlets are used.

      Embedded AP:

      $velocityPortletPreferences.setValue("showContextLink", "false")
      ...
      $theme.runtime("101_INSTANCE_01", "", $velocityPortletPreferences.toString())
      ...
      #set ($VOID = $velocityPortletPreferences.reset())
      

      Embedded Search:

      $velocityPortletPreferences.setValue("primarySearch", "com.liferay.portal.search.PortalOpenSearchImpl")
      ...
      $theme.runtime("3_INSTANCE_01", "", $velocityPortletPreferences.toString())
      ...
      #set ($VOID = $velocityPortletPreferences.reset())
      

      Phenomenon

      Under heavy load the stored portlet preferences of these embedded portlets may contain foreign settings, that is, for 101_INSTANCE_01 preference primarySearch appears and for 3_INSTANCE_01 preference showContextLink appears.

      Analyses

      This happens, because TemplatePortletPreferences is shared across requests and it isn't thread-safe.

      Steps to reproduce

      No manual steps have been found yet to reproduce. In order to be able to verify that the issue had been fixed, a unit test will be provided.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 33 weeks, 3 days ago

                Packages

                Version Package
                7.0.0 M4