You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/21 07:13:20 UTC

[GitHub] [pulsar] michaeljmarshall commented on a change in pull request #10166: Add debug logging when consumer fails to send permits to Broker

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



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -854,7 +854,17 @@ private void sendFlowPermitsToBroker(ClientCnx cnx, int numMessages) {
                 log.debug("[{}] [{}] Adding {} additional permits", topic, subscription, numMessages);
             }
 
-            cnx.ctx().writeAndFlush(Commands.newFlow(consumerId, numMessages), cnx.ctx().voidPromise());
+            cnx.ctx().writeAndFlush(Commands.newFlow(consumerId, numMessages))
+                    .addListener(writeFuture -> {
+                        if (log.isDebugEnabled()) {

Review comment:
       I agree. I think it'd be better to only add the listener if debug logging is enabled.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org