BewareMyPower commented on code in PR #15508:
URL: https://github.com/apache/pulsar/pull/15508#discussion_r867936174


##########
pulsar-client-cpp/lib/ClientImpl.cc:
##########
@@ -536,8 +536,13 @@ void ClientImpl::handleClose(Result result, SharedInt 
numberOfOpenHandlers, Resu
     }
     if (*numberOfOpenHandlers == 0) {
         Lock lock(mutex_);
-        state_ = Closed;
-        lock.unlock();
+        if (state_ == Closed) {
+            LOG_DEBUG("Client is already shutting down, possible race 
condition in handleClose");
+            return lock.unlock();

Review Comment:
   ```suggestion
               return;
   ```
   The `unlock` method could be invoked automatically.



-- 
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]

Reply via email to