You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Gary Tully (JIRA)" <ji...@apache.org> on 2017/01/18 11:54:26 UTC
[jira] [Commented] (AMQ-6545) Deadlock can occur during journal
file rotation
[ https://issues.apache.org/jira/browse/AMQ-6545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15827933#comment-15827933 ]
Gary Tully commented on AMQ-6545:
---------------------------------
nice catch [~cshannon] :-)
> Deadlock can occur during journal file rotation
> -----------------------------------------------
>
> Key: AMQ-6545
> URL: https://issues.apache.org/jira/browse/AMQ-6545
> Project: ActiveMQ
> Issue Type: Bug
> Components: Broker, KahaDB
> Affects Versions: 5.14.2
> Reporter: Christopher L. Shannon
> Assignee: Christopher L. Shannon
> Fix For: 5.15.0, 5.14.3
>
>
> There is an issue in the KahaDB Journal that can cause a deadlock. I saw the issue occur today when an Ack compaction was running while another thread retrieved the current data file and a rotation was required.
> https://issues.apache.org/jira/browse/AMQ-5603 introduced async preallocation and part of that commit introduced two locks instead of 1...dataFileIdLock and currentDataFile.
> The issue is that most of the time dataFileIdLock is acquired first and then currentDataFile. However, when calling the getCurrentDataFile() method if a rotation is needed then the currentDataFile lock is acquired before dataFileIdLock leading to a potential deadlock situation.
> The fix is to make sure that the two locks are always acquired in the same order.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)