]
Ovidiu Feodorov closed JBMESSAGING-247.
---------------------------------------
Resolution: Done
Race condition - out of order delivery
--------------------------------------
Key: JBMESSAGING-247
URL:
http://jira.jboss.com/jira/browse/JBMESSAGING-247
Project: JBoss Messaging
Issue Type: Bug
Reporter: Tim Fox
Assigned To: Tim Fox
Fix For: 1.2.0.Alpha1
This race condition has never actually been observed, but should be possible:
Out of sequence cancel.
Consider the following.
1. client does a recieve(1000).
2. This causes serverconsumerdelegate.activate() to be called.
3. The client times out.
4. The serverconsumerdelegate accepts a message and sends it asynch to the client
consumer.
5. serverconsumerdelegate.deactive() is called (too late though)
6. The message arrives at the messagecallbackhandler
7. The message is not accepted since the consumer is not receiving
8. ServerConsumerdelegate.cancel() is called.
9. client does another receive(1000)
10. This causes serverconsumerdelegate.activate() to be called.
11. A message is accepted and sent asynch to the client.
12. The cancel is processed. And the message put back on the queue
13. Wrong message is received at client!!
Race condition in asynchronous cancelling of message:
If consumer is waiting on receive(timeout) then times out, then just after that a message
is received, it gets cancelled.
But the cancellation could happen *after* the next receive occurs giving messages out of
sequence.
Solution to this is as follows:
If a message arrives late, instead of cancelling then asynchonrously, a flag is set and
the message id of the missed message is recorded
in the message callback handler, then when the next receive occurs, this flag is checked
and if true, then a cancel is done *before*
the next receive.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: