michaeljmarshall commented on a change in pull request #12259:
URL: https://github.com/apache/pulsar/pull/12259#discussion_r720547655



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
##########
@@ -875,11 +875,8 @@ protected WriteInEventLoopCallback 
newObject(Handle<WriteInEventLoopCallback> ha
         ClientCnx cnx = cnx();
         if (cnx == null || currentState != State.Ready) {
             log.info("[{}] [{}] Closed Producer (not connected)", topic, 
producerName);
-            synchronized (this) {
-                setState(State.Closed);
-                client.cleanupProducer(this);
-                clearPendingMessagesWhenClose();
-            }
+            client.cleanupProducer(this);

Review comment:
       Yes, we can add that to ` closeAndClearPendingMessages`.




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