Moving a page with thousands of incoming links takes a lot of time and may time out.

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 8.9.0, 9.2.0, 10.0.2
    • None
    • 2
    • Severity 3 - Minor
    • 0

      Issue Summary

      Copying pages with thousands of incoming links takes a lot of time and may time out. 

      Steps to Reproduce

      1. Setup a Confluence instance it could be (8.9.x, 9.2.x or 10.0.x) any version would do. 
      2. Create a page that has thousands of incoming links. Tested on 1000, 2000, 4000, and more incoming links. 
      3. Attempt to move that page to a different space.  

      Expected Results

      The page moves to the destination. 

      Actual Results

      The page takes quite a bit of time to move to the destination. This may timeout. In our tests, it looks like the move becomes significantly slower after 1500 links. The full thread during the move

      "Long running task: Move Page" prio=5 tid=0x00000000000003ab nid=0 runnable 
         java.lang.Thread.State: RUNNABLE
      	at java.base@21.0.8/java.lang.invoke.Invokers$Holder.invokeExact_MT(Invokers$Holder)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(DirectMethodHandleAccessor.java:153)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      	at java.base@21.0.8/java.lang.reflect.Method.invoke(Method.java:580)
      	at org.hibernate.property.access.spi.GetterMethodImpl.get(GetterMethodImpl.java:42)
      	at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValues(AbstractEntityTuplizer.java:587)
      	at org.hibernate.tuple.entity.PojoEntityTuplizer.getPropertyValues(PojoEntityTuplizer.java:154)
      	at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValues(AbstractEntityPersister.java:5289)
      	at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:210)
      	at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:166)
      	at org.hibernate.event.internal.AbstractFlushingEventListener$$Lambda/0x0000705a6ab10508.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/0x0000705a69ecabe8.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.mail.notification.persistence.dao.hibernate.HibernateNotificationDao.lambda$findNotificationByUserAndContent$0(HibernateNotificationDao.java:107)
      	at com.atlassian.confluence.mail.notification.persistence.dao.hibernate.HibernateNotificationDao$$Lambda/0x0000705a6bcdb450.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.mail.notification.persistence.dao.hibernate.HibernateNotificationDao.findNotificationByUserAndContent(HibernateNotificationDao.java:101)
      	at com.atlassian.confluence.internal.notification.persistence.DelegatingNotificationDaoInternal.findNotificationByUserAndContent(DelegatingNotificationDaoInternal.java:67)
      	at com.atlassian.confluence.mail.notification.DefaultNotificationManager.getNotificationByUserAndContent(DefaultNotificationManager.java:122)
      	at com.atlassian.confluence.mail.notification.DefaultNotificationManager.addContentNotification(DefaultNotificationManager.java:82)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$DMH/0x0000705a68d8f800.invokeInterface(LambdaForm$DMH)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$MH/0x0000705a6bfe9400.invoke(LambdaForm$MH)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$MH/0x0000705a68085800.invokeExact_MT(LambdaForm$MH)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(DirectMethodHandleAccessor.java:155)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      	at java.base@21.0.8/java.lang.reflect.Method.invoke(Method.java:580)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:360)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.transaction.interceptor.TransactionInterceptor$$Lambda/0x0000705a69dc25f8.proceedWithInvocation(Unknown Source)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:380)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:165)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:14)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at com.atlassian.confluence.util.profiling.ConfluenceMonitoringMethodInterceptor.invoke(ConfluenceMonitoringMethodInterceptor.java:36)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:223)
      	at jdk.proxy4/jdk.proxy4.$Proxy443.addContentNotification(Unknown Source)
      	at com.atlassian.confluence.impl.notifications.ContentEntityAutoWatcher.autowatchIfRequired(ContentEntityAutoWatcher.java:51)
      	at com.atlassian.confluence.impl.notifications.ContentEntityAutoWatcher.onEvent(ContentEntityAutoWatcher.java:30)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$DMH/0x0000705a68021400.invokeSpecial(LambdaForm$DMH)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$MH/0x0000705a6bfe7000.invoke(LambdaForm$MH)
      	at java.base@21.0.8/java.lang.invoke.Invokers$Holder.invokeExact_MT(Invokers$Holder)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(DirectMethodHandleAccessor.java:154)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      	at java.base@21.0.8/java.lang.reflect.Method.invoke(Method.java:580)
      	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:42)
      	at com.atlassian.confluence.event.DelegatingListenerInvoker.invoke(DelegatingListenerInvoker.java:23)
      	at com.atlassian.confluence.event.ConfluenceListenerInvoker.invoke(ConfluenceListenerInvoker.java:30)
      	at com.atlassian.event.internal.ComparableListenerInvoker.invoke(ComparableListenerInvoker.java:48)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.lambda$static$0(AsynchronousAbleEventDispatcher.java:37)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$$Lambda/0x0000705a68c84490.run(Unknown Source)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$$Lambda/0x0000705a68c29e20.execute(Unknown Source)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:85)
      	at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:102)
      	at com.atlassian.confluence.event.TimingEventPublisher.publish(TimingEventPublisher.java:75)
      	at com.atlassian.confluence.impl.content.DefaultContentEntityManager.autowatchIfRequired(DefaultContentEntityManager.java:647)
      	at com.atlassian.confluence.impl.content.DefaultContentEntityManager.saveContentEntity(DefaultContentEntityManager.java:228)
      	at com.atlassian.confluence.impl.content.DefaultPageManager.saveContentEntity(DefaultPageManager.java:1580)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$DMH/0x0000705a687ce800.invokeInterface(LambdaForm$DMH)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$MH/0x0000705a6bfe3c00.invoke(LambdaForm$MH)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$MH/0x0000705a68085800.invokeExact_MT(LambdaForm$MH)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(DirectMethodHandleAccessor.java:155)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      	at java.base@21.0.8/java.lang.reflect.Method.invoke(Method.java:580)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:360)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.transaction.interceptor.TransactionInterceptor$$Lambda/0x0000705a69dc25f8.proceedWithInvocation(Unknown Source)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:380)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:165)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:14)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at com.atlassian.confluence.util.profiling.ConfluenceMonitoringMethodInterceptor.invoke(ConfluenceMonitoringMethodInterceptor.java:36)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:223)
      	at jdk.proxy4/jdk.proxy4.$Proxy465.saveContentEntity(Unknown Source)
      	at com.atlassian.confluence.links.DefaultRelatedContentRefactorer.persistBodyModificationToContent(DefaultRelatedContentRefactorer.java:301)
      	at com.atlassian.confluence.links.DefaultRelatedContentRefactorer.updateReferrers(DefaultRelatedContentRefactorer.java:153)
      	at com.atlassian.confluence.links.DefaultRelatedContentRefactorer.updateReferrersForMovingPage(DefaultRelatedContentRefactorer.java:48)
      	at com.atlassian.confluence.links.RelatedContentRefactoringListener.handleEvent(RelatedContentRefactoringListener.java:42)
      	at java.base@21.0.8/java.lang.invoke.DirectMethodHandle$Holder.invokeVirtual(DirectMethodHandle$Holder)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$MH/0x0000705a68014000.invoke(LambdaForm$MH)
      	at java.base@21.0.8/java.lang.invoke.Invokers$Holder.invokeExact_MT(Invokers$Holder)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(DirectMethodHandleAccessor.java:154)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      	at java.base@21.0.8/java.lang.reflect.Method.invoke(Method.java:580)
      	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:42)
      	at com.atlassian.confluence.event.DelegatingListenerInvoker.invoke(DelegatingListenerInvoker.java:23)
      	at com.atlassian.confluence.event.ConfluenceListenerInvoker.invoke(ConfluenceListenerInvoker.java:30)
      	at com.atlassian.event.internal.ComparableListenerInvoker.invoke(ComparableListenerInvoker.java:48)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.lambda$static$0(AsynchronousAbleEventDispatcher.java:37)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$$Lambda/0x0000705a68c84490.run(Unknown Source)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$$Lambda/0x0000705a68c29e20.execute(Unknown Source)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:85)
      	at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:102)
      	at com.atlassian.confluence.event.TimingEventPublisher.publish(TimingEventPublisher.java:75)
      	at com.atlassian.confluence.impl.content.DefaultPageManager.publishPageMoveEvents(DefaultPageManager.java:1723)
      	at com.atlassian.confluence.impl.content.DefaultPageManager.doMovePageAsChild(DefaultPageManager.java:1222)
      	at com.atlassian.confluence.impl.content.DefaultPageManager.lambda$movePageAsChild$23(DefaultPageManager.java:1178)
      	at com.atlassian.confluence.impl.content.DefaultPageManager$$Lambda/0x0000705a6bf4e6f8.run(Unknown Source)
      	at com.atlassian.confluence.impl.content.DefaultPageManager.executeUnderLocks(DefaultPageManager.java:2038)
      	at com.atlassian.confluence.impl.content.DefaultPageManager.lambda$movePageAsChild$24(DefaultPageManager.java:1175)
      	at com.atlassian.confluence.impl.content.DefaultPageManager$$Lambda/0x0000705a6bf4e4d0.run(Unknown Source)
      	at com.atlassian.confluence.impl.content.DefaultPageManager.executeWithLogging(DefaultPageManager.java:2066)
      	at com.atlassian.confluence.impl.content.DefaultPageManager.movePageAsChild(DefaultPageManager.java:1180)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$DMH/0x0000705a687ce800.invokeInterface(LambdaForm$DMH)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$MH/0x0000705a68122c00.invoke(LambdaForm$MH)
      	at java.base@21.0.8/java.lang.invoke.LambdaForm$MH/0x0000705a68085800.invokeExact_MT(LambdaForm$MH)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(DirectMethodHandleAccessor.java:155)
      	at java.base@21.0.8/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      	at java.base@21.0.8/java.lang.reflect.Method.invoke(Method.java:580)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:360)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.transaction.interceptor.TransactionInterceptor$$Lambda/0x0000705a69dc25f8.proceedWithInvocation(Unknown Source)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:380)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:165)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:14)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at com.atlassian.confluence.util.profiling.ConfluenceMonitoringMethodInterceptor.invoke(ConfluenceMonitoringMethodInterceptor.java:36)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:223)
      	at jdk.proxy4/jdk.proxy4.$Proxy465.movePageAsChild(Unknown Source)
      	at com.atlassian.confluence.content.service.page.MovePageCommandImpl.executeInternal(MovePageCommandImpl.java:134)
      	at com.atlassian.confluence.core.service.AbstractServiceCommand$ServiceCommandState$2.execute(AbstractServiceCommand.java:148)
      	at com.atlassian.confluence.core.service.AbstractServiceCommand.execute(AbstractServiceCommand.java:60)
      	at com.atlassian.confluence.content.service.page.LongRunningTaskMovePageCommandDecorator.runInternal(LongRunningTaskMovePageCommandDecorator.java:68)
      	at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:26)
      	at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:39)
      	at com.atlassian.confluence.impl.util.concurrent.ConfluenceExecutors$ThreadLocalContextTaskWrapper.lambda$wrap$0(ConfluenceExecutors.java:50)
      	at com.atlassian.confluence.impl.util.concurrent.ConfluenceExecutors$ThreadLocalContextTaskWrapper$$Lambda/0x0000705a6bf4e2a8.run(Unknown Source)
      	at java.base@21.0.8/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
      	at java.base@21.0.8/java.util.concurrent.FutureTask.run(FutureTask.java:317)
      	at java.base@21.0.8/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
      	at java.base@21.0.8/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
      	at java.base@21.0.8/java.lang.Thread.runWith(Thread.java:1596)
      	at java.base@21.0.8/java.lang.Thread.run(Thread.java:1583)
      
         Locked ownable synchronizers:
      	- java.util.concurrent.ThreadPoolExecutor$Worker@232312bb 

      Workaround

      The only workaround that seems to work is as follows:

      • In Confluence 10.0.x, navigate to the affected page. Edit the title of the said page and move the page to the destination.
      • This works because when the title is edited, the page is now delinked from the associated links. This works as a byproduct of the following CONFSERVER-95804:

            Assignee:
            Unassigned
            Reporter:
            Ahmad Faridi (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: