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

Collaborative Editing takes an unfeasible amount of time to enable if a high number of stale drafts exist on the DB

XMLWordPrintable

      Summary

      Collaborative Editing takes an unfeasible amount of time to enable if the database holds a high number of stale drafts.

      Environment

      • Confluence 6+
      • DC or Standalone
      • Reproduced with 20k stale drafts

      Steps to Reproduce

      1. Start Confluence
      2. Start Synchrony
      3. Go to the Collaborative Editing management page
      4. Attempt to enable CE

      Expected Results

      Collaborative Editing is enabled in a few seconds.

      Actual Results

      The Change Mode popup keeps spinning and the task is not completed:

      Depending on the number of Stale Drafts, this task can take hours to complete or even fail.

      Notes

      If you take thread dumps while CE is being enabled, we can see that the Remove Stale Drafts task is ongoing. This class can be spotted on the threads:

      at com.atlassian.confluence.pages.DefaultPageManager.removeStaleSharedDrafts(DefaultPageManager.java:775)
      

      So, the problem is caused by the inefficiency of the removeStaleSharedDrafts task.

      Log Sample

      ERROR [Long running task: EnableTask] [springframework.transaction.support.TransactionTemplate] rollbackOnException Application exception overridden by rollback exception
       -- url: /rest/synchrony-interop/enable | referer: https://confluence.example.com/admin/confluence-collaborative-editor-plugin/configure.action | traceId: 3764f927fd378bc8 | userName: admin
      java.lang.IllegalStateException: Session/EntityManager is closed
      	...
      	at com.atlassian.confluence.pages.DefaultPageManager.removeStaleSharedDrafts(DefaultPageManager.java:764)
      	...
      	at com.sun.proxy.$Proxy2201.removeStaleSharedDrafts(Unknown Source)
      	at com.atlassian.confluence.plugins.synchrony.tasks.EnableTask.execute(EnableTask.java:53)
      	at com.atlassian.confluence.plugins.synchrony.tasks.AbstractConfigLongRunningTask.runInternal(AbstractConfigLongRunningTask.java:65)
      	at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:26)
      	at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:52)
      

      Workaround

      Follow the KB below in order to manually remove the staled drafts:

              dluong Duy Truong Luong
              bandreeti Bernardo Andreeti
              Votes:
              10 Vote for this issue
              Watchers:
              23 Start watching this issue

                Created:
                Updated:
                Resolved: