BewareMyPower commented on code in PR #17239:
URL: https://github.com/apache/pulsar/pull/17239#discussion_r953255225
##########
pulsar-client-cpp/lib/MultiTopicsConsumerImpl.cc:
##########
@@ -86,11 +86,14 @@ void
MultiTopicsConsumerImpl::handleOneTopicSubscribed(Result result, Consumer c
if (result != ResultOk) {
state_ = Failed;
+ // Use the first failed result
+ auto expectedResult = ResultOk;
+ failedResult.compare_exchange_strong(expectedResult, result);
Review Comment:
No. line 107 is in the block of `if (topicsNeedCreate->load() == 0)`, which
means only the last time `handleOneTopicSubscribed` is called. Usually, when
multiple topics failed to subscribe, the 1st topic would fail with the real
reason, but the following topics would fail with `ResultAlreadyClosed`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]