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

PageNotFound action can render Confluence inoperable




      In an environment where there is thousands of pages, the PageNotFound action is extremely CPU intensive when the alternative page search hits many pages.

      One such example to be considered is the space home page in an environment with thousands of spaces. If the home page of a space (EXAMPLE) is changed from "Home" to some other page and the URL mywiki/display/EXAMPLE/Home is visited, the alterative page search will hit every other "Home" page in all of the other spaces. From stack traces it appears that this operation will spend much time in the permission checking code path, triggering constant Hibernate session flushes to the DB.

      Such operations may last tens of minutes in production environments and are often exacerbated when frustrated users constantly click refresh in an attempt to elicit a response from the application.

      The options are to limit the number of alternatives we propose (useful in a general sense anyway, 2000 alternatives is not really helpful) and/or reduce the cost of permission checks in this case.

      Patch available

      To apply the patch (tested in Confluence 2.6 and later):

      1. Shut down Confluence
      2. Find the file alternativepages.vm in the pages/ directory of your Confluence application. Replace it with the attached version.
      3. Find the file xwork.xml in the WEB-INF/classes/ directory of your Confluence application. Find the following lines in the file:

      <action name="pagenotfound" class="com.atlassian.confluence.pages.actions.PageNotFoundAction">
          <result name="error" type="dispatcher">/fourohfour.action</result>
          <result name="success" type="velocity">/pages/alternativepages.vm</result>

      Change the class in the first line to "com.atlassian.confluence.core.ConfluenceActionSupport" as shown below:

      <action name="pagenotfound" class="com.atlassian.confluence.core.ConfluenceActionSupport">
          <result name="error" type="dispatcher">/fourohfour.action</result>
          <result name="success" type="velocity">/pages/alternativepages.vm</result>

      4. Start Confluence again. The "Page not found" page should now load quickly, irrespective of how many spaces are in the instance.


        1. alternativepages.vm
          1 kB
        2. lockup query.sql
          2 kB

        Issue Links



              dtaylor David Taylor (Inactive)
              christopher.owen@atlassian.com Christopher Owen [Atlassian]
              8 Vote for this issue
              10 Start watching this issue