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

TDM merger fails due to infinite recursive loop

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • High
    • None
    • 5.7.1, 5.8.10, 5.8.17, 5.10.1, Cloud, 5.10.2, 5.10.3, 5.10.8, 6.1.2, 6.2.4, 6.3.3
    • Editor - Drafts

    Description

      NOTE: After a thorough investigation and analysis of the issue by Development and Support teams, we found that this TDM Merge issue did not have as high of an impact to memory as previously assessed. Our attempts at reproducing an OutOfMemoryError (OOME) or stability problem have been unsuccessful. Both the support and development teams have done a thorough investigation around the linked support cases; and the conclusion is that TDM code is not to blame. The stack trace in the logs is merely just a warning which indicates that the infinite loop has been detected and hence terminated.

      We are closing this issue as Cannot Reproduce. If you are still experiencing the symptoms that relate to this bug please contact support by following the links at https://support.atlassian.com/confluence/ so we can help identify the root cause of your issue.

      This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Regression of CONFSERVER-32164

      Problem summary

      When Collaborative editing is disabled, or in a version of Confluence below 6.0, under specific conditions, Confluence can run out of memory when a user goes to edit a Confluence page or view his drafts (Username > Drafts), following a sequence of events:

      1. User A goes edit a page (Version 1)
      2. Confluence auto-saves a draft based on Version 1, and user does not save the page
      3. User B edits the same page and saves, promoting the page to Version 2
      4. User A views his drafts (or edits the page again)
      5. Confluence tries to merge the three versions (Version 1, Version 1 draft, and Version 2), and results in Confluence hanging

      Stack trace:

      2016-04-28 12:13:09,528 WARN [com.atlassian.confluence.plugins.merge.TDMMerger:thread-311] [confluence.plugins.merge.TDMMerger] mergeContentInternal Merge failed.
       -- url: /confluence/pages/editpage.action | referer: https://XXXX/confluence/display/SPACE/PAGE | userName: user | page: 1052053228 | action: editpage
      java.lang.RuntimeException: ASSERTION FAILED: Merge.treeMerge(). Infinitive recursive loop.
              at tdm.lib.Merge.treeMerge(Merge.java:107)
              at tdm.lib.Merge.treeMerge(Merge.java:173)
              at tdm.lib.Merge.treeMerge(Merge.java:173)
              at tdm.lib.Merge.treeMerge(Merge.java:173)
              at tdm.lib.Merge.treeMerge(Merge.java:173)
              at tdm.lib.Merge.merge(Merge.java:82)
              at com.atlassian.confluence.plugins.merge.TDMMerger.mergeContentInternal(TDMMerger.java:99)
              at com.atlassian.confluence.plugins.merge.TDMMerger.access$000(TDMMerger.java:46)
              at com.atlassian.confluence.plugins.merge.TDMMerger$1.call(TDMMerger.java:120)
              at com.atlassian.confluence.plugins.merge.TDMMerger$1.call(TDMMerger.java:116)
              at com.atlassian.sal.core.executor.ThreadLocalDelegateCallable.call(ThreadLocalDelegateCallable.java:42)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      

      Details:

      Workaround

      6.0 and later

      Make sure that Collaborative Editing is enabled and working, as the affected merge code is not used unless it is disabled.

      Warning:
      The below workarounds involve deleting one or more drafts. Drafts contain edits that have not yet been saved, so important work can be lost by deleting them.

      5.5 and later
      If a user has been identified causing this problem, they can go to /users/viewmydrafts.action page and discard either all of their drafts or just the draft for the page that is known to trigger this problem.

      All versions
      Alternatively, all the drafts can be deleted directly from the DB:

      1. Back up Confluence DB as a precaution
      2. Run the following DELETE statements against the DB:
        DELETE FROM BODYCONTENT WHERE contentid IN (SELECT contentid FROM CONTENT WHERE contenttype = 'DRAFT');
        DELETE FROM CONTENT WHERE contenttype = 'DRAFT';
        
      1. Confluence Admin > Cache Statistics > Flush all (down at the bottom)

      Attachments

        Issue Links

          Activity

            People

              hrehioui Hasnae (Inactive)
              onevalainen Olli Nevalainen
              Votes:
              24 Vote for this issue
              Watchers:
              42 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: