[ 
https://issues.apache.org/jira/browse/AMQ-7154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16776784#comment-16776784
 ] 

Christopher L. Shannon commented on AMQ-7154:
---------------------------------------------

[~gtully] - what do you think about this? I looked at this a bit and the 
simplest thing is to acquire the sendLock before the messagesLock in 
doPageInForDispatch but I am not sure what that will do for performance plus 
that seems like overkill because the lock is only needed if a message is 
expired and if the DLQ is even active.  This is the line I am talking about: 
[https://github.com/apache/activemq/blob/bcad7e1f6a6dd078d87787a03b56560e995ef773/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java#L1996]

Another option could be to queue up the messages to be expired to a list (up to 
some max of course) and then expire them after the page in is finished and the 
lock is released but this could get more tricky.

> Broker Deadlock while processing expired DLQ messages
> -----------------------------------------------------
>
>                 Key: AMQ-7154
>                 URL: https://issues.apache.org/jira/browse/AMQ-7154
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.12.0
>            Reporter: Kestutis Gedminas
>            Priority: Major
>         Attachments: amq.svg, threaddump.zip
>
>
> We get a deadlock on AMQ. After analysis, it looks like in case if expired 
> messages thread is processing DLQ queue at the same moment when poisonAck is 
> received we run into preexisting racing condition in code due to inconsistent 
> lock acquiring order.
> [ !amq.svg|width=1000!|^amq.svg]
>  
> [^threaddump.zip]
> [^amq.svg]
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to