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

Multiple clicks on inline tasks causes Confluence to perform badly due to database thread pool contention

    XMLWordPrintable

Details

    Description

      Symptoms

      A page has lots of inline task check boxes, and if you press lots of the checkboxes in quick succession, Confluence's CPU usage spikes.

      It's a pretty rare case that there are so many check boxes like this which can be clicked enough to cause this, but there are some customers who use the checkboxes this way.

      I believe the underlying cause here is that every time the check box is clicked, the entire page is saved back into Confluence, so if it's clicked repeatedly, there are a lot of saves happening all at once, causing database pool contention. A thread dump shows that many threads are locked waiting for the resource "com.mchange.v2.async.ThreadPoolAsynchronousRunner", indicating contention on the c3p0 thread pool. Eventually after stopping clicking the checkboxes, the CPU usage goes down, and threads are no longer locking on this resource.

      Steps to Reproduce

      1. Create a page in Confluence
      2. In that page, add lots and lots of inline tasks ([]), without linking to a user. It may help to create a big table, and fill every cell with a checkbox, where the associated caption is only ".".
      3. Save the page
      4. Click repeatedly on lots of check boxes
      5. Observe the high CPU usage
      6. Take a thread dump, and observe the high contention on the database connection pool resource

      Workaround

      Edit the page, and click the checkboxes whilst in edit mode, as this will only cause a save after making all the changes, rather than with every click.

      Alternatively, to disable the editing of inline task check boxes completely, disable the 'inline-tasks-resources' module of the Inline Tasks system plugin. To do so:

      Please make sure to create a backup of your database and home directory before attempting this.

      Removing Malfunctioning Add-ons covers this process in depth, but below is a specific example for the inline-tasks-resources module.

      1. Shut down Confluence
      2. Run the following query:
        select BANDANAVALUE from BANDANA where BANDANAKEY = 'plugin.manager.state.Map'

        This will return a map that may look something like this:

        <map>
          <entry>
            <string>com.atlassian.confluence.ext.usage</string>
            <boolean>false</boolean>
          </entry>
        </map>
      3. Copy the existing entry and add an entry for the inline-tasks-resources module. For example:
        <map>
          <entry>
            <string>com.atlassian.confluence.ext.usage</string>
            <boolean>false</boolean>
          </entry>
          <entry>
            <string>com.atlassian.confluence.plugins.confluence-inline-tasks</string>
            <boolean>false</boolean>
          </entry>
        </map>

        If there are no entries, just add a single entry for the inline-tasks-resources module:

        <map>
          <entry>
            <string>com.atlassian.confluence.plugins.confluence-inline-tasks</string>
            <boolean>false</boolean>
          </entry>
        </map>
      4. Update the bandana table:
        update bandana set bandanavalue = '<YOUR NEW PLUGIN STATE MAP>' where bandanakey = 'plugin.manager.state.Map'
      5. Restart Confluence

      Attachments

        Issue Links

          Activity

            People

              mtran@atlassian.com Minh Tran
              dmason David Mason (Inactive)
              Votes:
              9 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: