Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-100330

When performing a "Custom Export" in PDF or HTML the page tree keeps loading infinitely, especially with large spaces and complex page hierarchy

XMLWordPrintable

      Issue Summary

      With large spaces and page hierarchy, when a user browses to Export > PDF > Custom Export or Export > HTML > Custom Export, the page tree keeps loading indefinitely or takes too long.

      Steps to Reproduce

      1. Create a large space with long page hierarchies (created a space with 20 level of hierarchy and the total pages in the space need to be 5k ~ 20K)
      2. Can login as system/application admin or space admin user to reproduce the issue
      3. Go to the space with huge content and a complex page hierarchy
      4. Browse to Space Tools > Content tools > Export
      5. Chose one of the following actions:
        • PDF > Custom Export
        • HTML > Custom Export

      Expected Results

      Page tree should be displayed for the user in order to select the pages for the HTML/PDF export

      Actual Results

      The page tree keeps loading and take a long time:

      In the Thread dumps, we can see the following stack trace when reproducing the issue with a PDF Custom Export:

      "Long running task: Content tree build for PDF export" #2472 [2896] prio=5 os_prio=0 cpu=1559476.98ms elapsed=1591.19s tid=0x00007ac5ef6ce210 nid=2896 runnable  [0x00007ac5b54fa000]
         java.lang.Thread.State: RUNNABLE
              at org.hibernate.type.AbstractStandardBasicType.isEqual(AbstractStandardBasicType.java:194)
              at org.hibernate.type.AbstractStandardBasicType.isEqual(AbstractStandardBasicType.java:188)
              at org.hibernate.engine.internal.Collections.prepareCollectionForUpdate(Collections.java:258)
              at org.hibernate.engine.internal.Collections.processReachableCollection(Collections.java:231)
              at org.hibernate.event.internal.FlushVisitor.processCollection(FlushVisitor.java:53)
              at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:104)
              at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:65)
              at org.hibernate.event.internal.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:59)
              at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:187)
              at org.hibernate.event.internal.AbstractFlushingEventListener$$Lambda/0x00007ac60a4fe278.accept(Unknown Source)
              at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
              at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:229)
              at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:93)
              at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:50)
              at org.hibernate.internal.SessionImpl$$Lambda/0x00007ac609d77658.accept(Unknown Source)
              at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
              at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1372)
              at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1452)
              at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649)
              at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617)
              at com.atlassian.confluence.security.persistence.dao.hibernate.HibernateContentPermissionSetDao.lambda$getInheritedContentPermissionSets$2(HibernateContentPermissionSetDao.java:114)
              at com.atlassian.confluence.security.persistence.dao.hibernate.HibernateContentPermissionSetDao$$Lambda/0x00007ac609bc39d8.doInHibernate(Unknown Source)
              at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:366)
              at org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:319)
              at com.atlassian.confluence.security.persistence.dao.hibernate.HibernateContentPermissionSetDao.getInheritedContentPermissionSets(HibernateContentPermissionSetDao.java:102)
              at com.atlassian.confluence.core.DefaultInheritedContentPermissionManager.getInheritedContentPermissionSets(DefaultInheritedContentPermissionManager.java:44)
              at com.atlassian.confluence.core.DefaultInheritedContentPermissionManager.getInheritedContentPermissionSetsIncludeEdit(DefaultInheritedContentPermissionManager.java:37)
              at com.atlassian.confluence.impl.security.CachingInheritedContentPermissionManager.lambda$getInheritedContentPermissionSets$2(CachingInheritedContentPermissionManager.java:96)
              at com.atlassian.confluence.impl.security.CachingInheritedContentPermissionManager$$Lambda/0x00007ac60bd14000.get(Unknown Source)
              at com.atlassian.confluence.impl.security.ContentPermissionSetCache.lambda$getOrLoad$0(ContentPermissionSetCache.java:41)
              at com.atlassian.confluence.impl.security.ContentPermissionSetCache$$Lambda/0x00007ac60bd14218.get(Unknown Source)
              at com.atlassian.confluence.cache.CacheOperations.lambda$get$0(CacheOperations.java:172)
              at com.atlassian.confluence.cache.CacheOperations$$Lambda/0x00007ac609d6f7b0.apply(Unknown Source)
              at java.util.HashMap.computeIfAbsent(java.base@21.0.7/HashMap.java:1228)
              at com.atlassian.confluence.cache.CacheOperations.get(CacheOperations.java:172)
              at com.atlassian.confluence.cache.DeferredOperationsCache.getOrLoad(DeferredOperationsCache.java:92)
              at com.atlassian.confluence.cache.DeferredOperationsCache.get(DeferredOperationsCache.java:56)
              at com.atlassian.confluence.cache.TransactionalCacheFactory$TransactionalCache.get(TransactionalCacheFactory.java:329)
              at com.atlassian.confluence.impl.cache.tx.TransactionAwareCache$1.get(TransactionAwareCache.java:43)
              at com.atlassian.confluence.impl.security.ContentPermissionSetCache.getOrLoad(ContentPermissionSetCache.java:39)
              at com.atlassian.confluence.impl.security.CachingInheritedContentPermissionManager.getInheritedContentPermissionSets(CachingInheritedContentPermissionManager.java:96)
              at com.atlassian.confluence.impl.security.CachingInheritedContentPermissionManager.getInheritedContentPermissionSetsIncludeEdit(CachingInheritedContentPermissionManager.java:87)
              at com.atlassian.confluence.core.DefaultContentPermissionManager.getInheritedContentPermissionSets(DefaultContentPermissionManager.java:175)
              at com.atlassian.confluence.core.DefaultContentPermissionManager.hasInheritedContentLevelViewPermissions(DefaultContentPermissionManager.java:314)
              at com.atlassian.confluence.core.DefaultContentPermissionManager.hasContentLevelPermission(DefaultContentPermissionManager.java:212)
              at com.atlassian.confluence.core.ContentPermissionManager.hasContentLevelPermission(ContentPermissionManager.java:97)
              at java.lang.invoke.LambdaForm$DMH/0x00007ac60b9fbc00.invokeInterface(java.base@21.0.7/LambdaForm$DMH)
      ...
      ...
               at com.atlassian.confluence.pages.TreeBuilder.hasExportPermission(TreeBuilder.java:69)
               at com.atlassian.confluence.pages.TreeBuilder.lambda$addSortedChildren$3(TreeBuilder.java:80)
               at com.atlassian.confluence.pages.TreeBuilder$$Lambda/0x00007ac609bc3338.test(Unknown Source)
               at java.util.stream.ReferencePipeline$2$1.accept(java.base@21.0.7/ReferencePipeline.java:178)
               at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(java.base@21.0.7/ArrayList.java:1708)            
      ...
      ... 

      When running an HTML export, the name of the affected thread will directly refer to the exportspacetree.action endpoint:

      "http-nio-8090-exec-7 url: /confluence/spaces/exportspacetree.action; user: admin" #650 [768] daemon prio=5 os_prio=0 cpu=951129.42ms elapsed=7205.71s tid=0x000076a26cd43280 nid=768 runnable  [0x000076a1a5cec000]
         java.lang.Thread.State: RUNNABLE
      	at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:106)
      	at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:65)
      ...
      ...
      

      Workaround

      Workaround for PDF export

      • Export the entire space or export individual pages from — go to the page and select   (Tools) > Export to PDF.
      • Reduce the size of the space and page hierarchy

      Workaround for HTML export

      • There is no workaround for HTML export other than reduce the size of the space and the complexity of the page hierarchy

      Versions Tested

      Please confirm all versions that have been tested for this issue, and indicate whether the tested version is affected or not affected, below: 

      Testing Requirements Version Affected Version
      Customers Reported Version 9.2.6 yes
      Most Recent Bug-Fix Release 9.5.2 yes
      Previous minor version 9.4.1 yes
      Previous Major Release    
      Most Recent LTS 9.2.6 yes
      Previous Supported LTS 8.5.24 no
      Other Versions.. 9.2.0 no
      Other Versions.. 9.2.5 no
      (Add rows as needed)    

              9b1d3eb31642 Duncan Tweed
              d51fc966722f Shivangi Nayak
              Votes:
              3 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: