Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.3.3, 4.3.7
-
None
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
- Create a page in Confluence
- 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 ".".
- Save the page
- Click repeatedly on lots of check boxes
- Observe the high CPU usage
- 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.
- Shut down Confluence
- 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>
- 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>
- Update the bandana table:
update bandana set bandanavalue = '<YOUR NEW PLUGIN STATE MAP>' where bandanakey = 'plugin.manager.state.Map'
- Restart Confluence