race condition of messageHandler@SubscribeResponseHandler
---------------------------------------------------------

                 Key: BOOKKEEPER-54
                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-54
             Project: Bookkeeper
          Issue Type: Bug
          Components: hedwig-client
    Affects Versions: 3.4.0
            Reporter: xulei
             Fix For: 3.4.0


1. As we know, when stopDelivery, the messageHandler will be set to null.
2. We also know that in SubscribeReconnectCallback.operationFinished(), we will 
check if the messageHandler is null, if messageHandler is not null, we will 
startDelivery.

Both the reconnect thread and the main thread will race the messageHandler. For 
example,
the reconnect handler checked that messageHandler is not null, and will 
startDelivery, then main thread  exec stopDelivery, set messageHandler to null, 
and then reconnect thread exec startDelivery, set messageHandler back again. so 
although the client app stopDelivery, it still can receive message.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to