Bitbucket Server stops responding due to a Java-level deadlock
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
症状
Bitbucket Server becomes unresponsive.
The sequence of events that lead to this situation are not yet known and it is not easily reproducible.
環境
The issue affects instances using Java 8.
スレッド ダンプ
Thread dumps taken during this time would show Java-level deadlocks.
The deadlock is encountered between a ClientPoller
, BlockPoller
and a few other http/s threads on the following methods:
- java.nio.channels.spi.AbstractSelectableChannel.removeKey
- java.nio.channels.spi.AbstractSelector.cancel
原因
The deadlock is caused by the following bug in Tomcat versions 9.0.20 to 9.0.31:
64007 - A Deadlock with Poller run and cancelledKey
影響を受けるバージョン
The Bitbucket Server versions affected by this bug are:
Bitbucket バージョン | Embedded Tomcat Version |
---|---|
6.5.x | 9.0.21 |
6.6.x | 9.0.21 |
6.7.x | 9.0.21 |
6.8.x | 9.0.21 |
6.9.x | 9.0.21 |
6.10.0 - 6.10.2 | 9.0.27 |
7.0.0 - 7.0.1 | 9.0.30 |
回避策
Perform a restart of Bitbucket Server.
For multi-node Bitbucket Data Center instances, only the affected node needs to be restarted.
修正バージョン
This issue is fixed in Bitbucket Server versions 6.10.3+, 7.0.2+, 7.1.0+ or later.
These versions use Tomcat version 9.0.31+ or later.
Java 11
If an upgrade to a fix version of Bitbucket is not possible, an alternative is to use Java 11 where the issue with deadlocks is addressed (reference: Tomcat repository commit). Java 11 is installed by default with the Bitbucket 8.6.0 installer.