Troubleshooting deadlocks in Confluence

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

Some period after launch, Confluence hangs or runs slowly. An error message appears in the logs like:

1 2009-04-07 05:38:57,333 WARN [Timer-0] [mchange.v2.async.ThreadPoolAsynchronousRunner] run com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@26b07663 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!

Diagnosis

This can be hard to diagnose because the message does not necessarily mean there is a deadlock. The code will output an apparent deadlock message when it attempts to grab a new database connection and there is none available.

This could be for a variety of reasons (listed below). Take three thread dumps to see the behavior of Confluence when Confluence begins performing poorly.

If you are experiencing an actual deadlock, more than likely your database will report it in its logs. If there are no reports of deadlocks in your database logs, then it is likely to be 1, 2 or 3 of the causes below. If there is, it can be 4 or 5 below.

Make sure you've got a supported database with a current driver.

Causes and Resolutions

Deadlocks can result from a variety of different causes:

  1. Database connection pool has too few connections. See Confluence slows and times out during periods of high load due to database connection pool

  2. A Confluence crashes due to 'OutOfMemoryError Java heap space' error is occurring. Check that page for diagnosis and resolutions.

  3. A script or Remote API process is hammering the server. Disable any Remote API scripts or disable the Remote API from Administration >> General Information.

  4. The database is not optimized.

  5. If you are using MS SQL Server, check if you are affected by this known deadlock problem.

  6. Adding pages concurrently can result in deadlocks. See CONFSERVER-14789.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.