mylesmac12 opened a new pull request, #2761:
URL: https://github.com/apache/activemq/pull/2761

   With prefetch=0 a deadlock occurs between the client and broker upon 
receiving a duplicate message. receive() sends the broker a pull request 
(asking for one message) then calls ActiveMQMessageConsumer#dequeue(-1) which 
sleeps (with no timeout set) until something is put in the local buffer. The 
broker responds with a message if available; if no message is available within 
the timeout the “nothing” signal is returned. Either of these messages are put 
in the buffer by the client, wakes the sleeping thread, and continues the loop.
   
   During the pull of the first instance of the duplicated message, the broker 
sends the message, the client checks it and puts it in the buffer, the listener 
thread wakes, and the loop calls receive() again. During the pull of the second 
instance of the duplicated message, the broker sends the message again. The 
client notices it’s a duplicate, logs …suppressing duplicate delivery on 
connection, and discards the message without putting any message in the buffer. 
The waiting thread (from dequeue(-1)) is never woken: no “nothing” was sent (as 
a message was sent but discarded) and nothing appears in the buffer. The 
deadlock: client’s listener thread awaits something to land in the buffer, and 
the broker awaits the next explicit pull request.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to