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/10 14:26:59 UTC

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

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



##########
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:
       in case of not "debug enabled"...can we keep using the voidPromise ?
   we are not in an hotpath but we can save a little resources.
   
   or is it worthless ?




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