Skip to content

Conversation

@jonnxu
Copy link
Contributor

@jonnxu jonnxu commented Jan 8, 2019

#43 One Consumer Consume One Message Twice At The Same Time

test and verify log:
2019-Jan-08 23:52:32.136558:pullMessageAsync set opaque:31, mq:MessageQueue [topic=jonnxu_topic, brokerName=broker-a, queueId=2]
2019-Jan-08 23:52:32.136723:invokeAsync success, addr:101.132.96.164:10911, code:11, opaque:31

2019-Jan-08 23:52:49.905802:####### need delete the pullrequest for opaque:31, mq:MessageQueue [topic=jonnxu_topic, brokerName=broker-a, queueId=2]
2019-Jan-08 23:52:49.905819:succ deleted the async pullrequest for opaque:31, mq:MessageQueue [topic=jonnxu_topic, brokerName=broker-a, queueId=2]
2019-Jan-08 23:52:49.905833:cancelTimerCallback: opaque:31
2019-Jan-08 23:52:49.905878:handleAsyncPullForResponseTimeout opaque:31, e_code:0, msg:Success
2019-Jan-08 23:52:49.906101:drop mq:MessageQueue [topic=jonnxu_topic, brokerName=broker-a, queueId=2], delete opaque:31
2019-Jan-08 23:52:51.368690:code:19, remark:JAVA, version:273, opaque:31, flag:1, remark:OFFSET_OVERFLOW_ONE, headLen:233, bodyLen:0
2019-Jan-08 23:52:51.368702:broker addr: 101.132.96.164, broker port: 10911
2019-Jan-08 23:52:51.368757:responseFuture was deleted by timeout of opaque:31

@jonnxu
Copy link
Contributor Author

jonnxu commented Jan 9, 2019

#43 One Consumer Consume One Message Twice At The Same Time

the reason for this issue is:
after broker restart, consumer will dorebalance, when drop mq(broker_b, queue=3) but doesn't delete the pull message(opaque=392989) it have send to broker,
after a while(08:57:11.515914) when mq (broker_b, queue=3) allocate to this consumer again, it will trigger pull reqeust to this mq((broker-b, queue=3))
after a while again (08:57:15.911154), consumer receive the response for this pull message(opaque=392989), it will trigger consumer send another pull request to this mq(broker-b, queue=3)
so, there are two pull reqeust to one mq(broker-b, queue=3) at the same time

@ShannonDing ShannonDing added the bug Something isn't working label Jan 9, 2019
Copy link
Member

@ShannonDing ShannonDing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShannonDing ShannonDing merged commit 938e773 into apache:master Jan 11, 2019
return false;
}

int PullRequest::getLatestPullRequestOpaque() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use const? and it cause compile error in macos:

no matching constructor for initialization of 'boost::lock_guardboost::mutex'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it also in ci build 25:

/home/travis/build/apache/rocketmq-client-cpp/src/consumer/PullRequest.cpp: In member function ‘int rocketmq::PullRequest::getLatestPullRequestOpaque() const’:
/home/travis/build/apache/rocketmq-client-cpp/src/consumer/PullRequest.cpp:266:59: error: no matching function for call to ‘boost::lock_guardboost::mutex::lock_guard(const boost::mutex&)’
boost::lock_guardboost::mutex lock(m_pullRequestLock);

@ShannonDing ShannonDing added this to the 1.2.1 milestone Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants