race condition of outstandingMsgSet@SubscribeResponseHandler
--------------------------------------------------------------
Key: BOOKKEEPER-53
URL: https://issues.apache.org/jira/browse/BOOKKEEPER-53
Project: Bookkeeper
Issue Type: Bug
Components: hedwig-client
Affects Versions: 3.4.0
Reporter: xulei
Fix For: 3.4.0
outstandingMsgSet is a Set, so it is not thread-safe. The detail is as below:
MessageConsumeRetryTask is In a timer, so in timer thread, when the timer is
up, it will cause a outstandingMsgSet add operation:
MessageConsumeRetryTask.run() -> outstandingMsgSet.add(message) ->
outstandingMsgSet.add(message)
At the same time, in other thread(maybe main thread), there may be other
operations of this outstandingMsgSet:
MessageConsumeCallback.operationFinished() -> messageConsumed(Message message)
-> outstandingMsgSet.remove(message);
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira