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

Same FileEntry can be exported multiple times to the same LAR path

    Details

      Description

      The export algorithm takes care of not exporting the same element twice, based on a path map which keeps track of exported paths. This is not being checked when exporting the physical file corresponding to a DLFileEntry.

      As a result, the file will be added to the LAR as a zip entry as many times as the DLFileEntry is being referenced. The zip entry is added over and over again in the same path within the LAR file. This makes it unnoticeable if you examine the generated LAR.

      A worst-case scenario that exploits this problem is described as follows:

      • A big site uses a theme for all its pages.
      • The theme embeds a web content display portlet
      • The portlet shows the same web content, which embeds an image stored in the DM.

      The result of exporting this site is that the image is exported over and over again in the LAR. Export times grow linearly with the number of times the same image is zipped.

      Following trace demonstrates the behavior. was generated with some non-blocking breakpoints in all variants of PortletDataContextImpl.addZipEntry(), and in BaseStagedModelDataHandler.exportStagedModel(), in the line calling doExportStagedModel()

      Adding ZIP entry: /group/10355/com.liferay.portal.model.LayoutFriendlyURL/10400.xml
      .....
      Adding ZIP entry: /group/10355/portlet/167/0/portlet.xml
      Exporting 49179b71-b81f-f182-8c0e-d02b430025a3
      Adding ZIP entry: /group/10355/com.liferay.portlet.documentlibrary.model.DLFileEntry/10366/1.0
      Adding ZIP entry: /group/10355/com.liferay.portlet.documentlibrary.model.DLFileEntry/10366.xml
      ...
      Adding ZIP entry: /group/10355/com.liferay.portlet.dynamicdatamapping.model.DDMTemplate/10386.xml
      Exporting 49179b71-b81f-f182-8c0e-d02b430025a3
      Adding ZIP entry: /group/10355/com.liferay.portlet.documentlibrary.model.DLFileEntry/10366/1.0
      Adding ZIP entry: /group/10355/com.liferay.portlet.journal.model.JournalArticle/10389.xml
      ...
      Adding ZIP entry: /group/10355/portlet/33/0/portlet.xml
      Exporting 49179b71-b81f-f182-8c0e-d02b430025a3
      Adding ZIP entry: /group/10355/com.liferay.portlet.documentlibrary.model.DLFileEntry/10366/1.0
      Adding ZIP entry: /group/10355/portlet/199/10355/portlet-data.xml
      Adding ZIP entry: /group/10355/portlet/199/preferences/group/10355/0/portlet-preferences.xml
      Adding ZIP entry: /group/10355/portlet/199/0/portlet.xml
      Exporting 49179b71-b81f-f182-8c0e-d02b430025a3
      Adding ZIP entry: /group/10355/com.liferay.portlet.documentlibrary.model.DLFileEntry/10366/1.0
      Adding ZIP entry: /group/10355/portlet/56_INSTANCE_OZiIZDRSemLM/preferences/layout/0/10399/portlet-preferences.xml
      Adding ZIP entry: /group/10355/portlet/56_INSTANCE_OZiIZDRSemLM/10399/portlet.xml
      Exporting 49179b71-b81f-f182-8c0e-d02b430025a3
      Adding ZIP entry: /group/10355/com.liferay.portlet.documentlibrary.model.DLFileEntry/10366/1.0
      Adding ZIP entry: /group/10355/portlet/56_INSTANCE_NKVtBZQX7tjG/preferences/layout/0/10399/portlet-preferences.xml
      Adding ZIP entry: /group/10355/portlet/56_INSTANCE_NKVtBZQX7tjG/10399/portlet.xml
      Exporting 49179b71-b81f-f182-8c0e-d02b430025a3
      Adding ZIP entry: /group/10355/com.liferay.portlet.documentlibrary.model.DLFileEntry/10366/1.0
      Adding ZIP entry: /group/10355/portlet/56_INSTANCE_DNBTDDwtLPjV/preferences/layout/0/10411/portlet-preferences.xml
      Adding ZIP entry: /group/10355/portlet/56_INSTANCE_DNBTDDwtLPjV/10411/portlet.xml
      Exporting 49179b71-b81f-f182-8c0e-d02b430025a3
      Adding ZIP entry: /group/10355/com.liferay.portlet.documentlibrary.model.DLFileEntry/10366/1.0
      Adding ZIP entry: /group/10355/portlet/56_INSTANCE_BhdaBkb72x5o/preferences/layout/0/10411/portlet-preferences.xml
      Adding ZIP entry: /group/10355/portlet/56_INSTANCE_BhdaBkb72x5o/10411/portlet.xml
      Exporting 49179b71-b81f-f182-8c0e-d02b430025a3
      Adding ZIP entry: /group/10355/com.liferay.portlet.documentlibrary.model.DLFileEntry/10366/1.0
      Adding ZIP entry: /group/10355/portlet/56_INSTANCE_fEWqVklxjZzF/preferences/layout/0/10411/portlet-preferences.xml
      ....
      Adding ZIP entry: /manifest.xml

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              joyce.wang Joyce Wang
              Reporter:
              daniel.sanz Daniel Sanz
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 20 weeks ago

                  Packages

                  Version Package
                  6.2.3 CE GA4
                  6.2.X EE
                  7.0.0 M3