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

Comparing Huge Changes Between Versions in Page History Throws IndexOutOfBoundsException

      Steps to reproduce:

      1. create large page
      2. do more than 9500 changes to the content

      Expected behaviour:
      File comparison appear

      Actual:
      Error thrown in UI:

      In atlassian-confluence.log:

      2015-12-18 18:37:22,525 ERROR [http-bio-8563-exec-2] [confluence.pages.actions.AbstractDiffPagesAction] execute Error while generating diff: (page: 54-fix v.6 (6291463) vs page: 54-fix v.7 (5505039))
       -- referer: http://localhost:8563/pages/viewpreviousversions.action?pageId=5505039 | url: /pages/diffpagesbyversion.action | userName: admin | action: diffpagesbyversion | page: 5505039
      com.atlassian.confluence.diff.DiffException: Index: 175220, Size: 175220
      	at com.atlassian.confluence.diff.DaisyHtmlDiffer.createOrGetFutureDiff(DaisyHtmlDiffer.java:159)
      	at com.atlassian.confluence.diff.DaisyHtmlDiffer.diff(DaisyHtmlDiffer.java:103)
      	at com.atlassian.confluence.diff.WikiConvertingHtmlDiffer.diff(WikiConvertingHtmlDiffer.java:31)
      	...
      	
      	Caused by: java.lang.IndexOutOfBoundsException: Index: 175220, Size: 175220
      	at java.util.ArrayList.rangeCheck(ArrayList.java:635)
      	at java.util.ArrayList.get(ArrayList.java:411)
      	at org.outerj.daisy.diff.html.TextNodeComparator.getTextNode(TextNodeComparator.java:67)
      	at org.outerj.daisy.diff.html.TextNodeComparator.handlePossibleChangedPart(TextNodeComparator.java:136)
      
      

      Diagnosis:
      Problem still happening even after setting the timeout to 4.5 minute and increasing the heap:

      1. parameter confluence.html.diff.timeout has been increased as per advice in https://confluence.atlassian.com/display/CONFKB/Comparing+Page+Versions+Fails+Due+to+Timeout+Exceeded
        -Dconfluence.html.diff.timeout=270000
        
        
      1. increase the heap (-Xmx) for the instance
      2. Problem still occur

       

      Workaround:

      No known workaround

          Form Name

            [CONFSERVER-40274] Comparing Huge Changes Between Versions in Page History Throws IndexOutOfBoundsException

            Since the configuration changes require a restart I haven't been able to test it to see if it works. However, what I have noticed is that when selecting specific versions of the page (from the Page History page) we get this error well before our current timeout (which is set to 30 seconds). So we get the error within a second or two of hitting the "Comapre selected versions" button.

             

            So for example we have a page with 28 revisions. When selecting revision 28 and 8 to diff we get the error message almost instantly. It doesn't look like it waits for the timeout to even occur. We're running Confluence 5.8.10. Also, is it safe to assume that Confluence 6 does not exhibit these timeout errors?

            Mark H. Williams added a comment - Since the configuration changes require a restart I haven't been able to test it to see if it works. However, what I have noticed is that when selecting specific versions of the page (from the Page History page) we get this error well before our current timeout (which is set to 30 seconds). So we get the error within a second or two of hitting the "Comapre selected versions" button.   So for example we have a page with 28 revisions. When selecting revision 28 and 8 to diff we get the error message almost instantly. It doesn't look like it waits for the timeout to even occur. We're running Confluence 5.8.10 . Also, is it safe to assume that Confluence 6 does not exhibit these timeout errors?

            Yes, that seemed to resolve the issue for us. Thank you!

            John Harmon added a comment - Yes, that seemed to resolve the issue for us. Thank you!

            Thanks Stefan. I doubled the memory and restarted the services. Just waiting to test it when I get the URL from the employee that initially reported the issue. I will report back once I have a chance to check it.

            John Harmon added a comment - Thanks Stefan. I doubled the memory and restarted the services. Just waiting to test it when I get the URL from the employee that initially reported the issue. I will report back once I have a chance to check it.

            @John, as far as I understand the situation the underlying problem can be either a timeout (if processing takes too long) or an out of memory situation. From your comment I take it you only tried to increase the timeout but not the heap memory yet. Maybe worth a try to increase the Xmx by 0.5-1GB and see if that solves the problem (it did for me at least).

            That said: The issue is also present in Confluence 5.5.7.

            Stefan Hett added a comment - @John, as far as I understand the situation the underlying problem can be either a timeout (if processing takes too long) or an out of memory situation. From your comment I take it you only tried to increase the timeout but not the heap memory yet. Maybe worth a try to increase the Xmx by 0.5-1GB and see if that solves the problem (it did for me at least). That said: The issue is also present in Confluence 5.5.7.

            John Harmon added a comment - - edited

            The workaround does NOT work for me. Same issue. I am on 5.10.3

            John Harmon added a comment - - edited The workaround does NOT work for me. Same issue. I am on 5.10.3

            commenting to subscribe. Happening for us too. I have bumped the timeout up 2x now, and still hasn't made a difference. Bumping it up one more time to see if we can workaround this issue.

            John Harmon added a comment - commenting to subscribe. Happening for us too. I have bumped the timeout up 2x now, and still hasn't made a difference. Bumping it up one more time to see if we can workaround this issue.

              Unassigned Unassigned
              jalbion Janet Albion (Inactive)
              Affected customers:
              8 This affects my team
              Watchers:
              14 Start watching this issue

                Created:
                Updated: