Dispatcher's stop logic can cause mis-processing of messages.
-------------------------------------------------------------

                 Key: QPID-2117
                 URL: https://issues.apache.org/jira/browse/QPID-2117
             Project: Qpid
          Issue Type: Bug
          Components: Java Client
    Affects Versions: M4, M3, 0.5
            Reporter: Martin Ritchie


Currently the logic for the Dispatcher can be simplified as follows:

while (msg =_queue.take() != null)
  Stop if required
  Process Message

There are a couple of problems, the first is that if the _queue is not empty 
when the stop request is made then the dispatcher will remove a message from 
_queue and sit in the Stop until it is restarted, where it will then process 
the message.

The second issue is that if the queue is empty when the stop is requested then 
nothing happens... until a message is received and the dispatcher then removes 
it and holds it in the Stop.

Finally. there is no way to stop the dispatcher once it has made the take() 
call, other than via an interrupt() call.

Changes to the dispatcher should be done to allow it to be stopped and started 
with validation i.e. thread A calls dispatcher.stop() and that does not return 
until the dispatcher has stopped. Currently it is a request that is never 
confirmed.

In providing this functionality we will be able to avoid the interrupt() call 
that has already been identified as in need of addressing see QPID-1515.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to