You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "AnonHxy (via GitHub)" <gi...@apache.org> on 2023/03/14 03:55:38 UTC

[GitHub] [pulsar] AnonHxy commented on a diff in pull request #19775: [Bug] [Perf] PerformanceProducer do not produce expected number of messages.

AnonHxy commented on code in PR #19775:
URL: https://github.com/apache/pulsar/pull/19775#discussion_r1134898824


##########
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java:
##########
@@ -604,14 +606,18 @@ private static void runProducer(int producerId,
             AtomicLong numMessageSend = new AtomicLong(0);
             Semaphore numMsgPerTxnLimit = new Semaphore(arguments.numMessagesPerTransaction);
             while (true) {
+                if (produceEnough) {

Review Comment:
   Can `produceEnough` be true here?



##########
pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java:
##########
@@ -753,11 +760,13 @@ private static void runProducer(int producerId,
             if (null != client) {
                 try {
                     client.close();
-                    PerfClientUtils.exit(1);
                 } catch (PulsarClientException e) {
                     log.error("Failed to close test client", e);
                 }
             }
+            if (!produceEnough) {

Review Comment:
   How about move this block to line before `if (null != client)`?  Or catch `Throwable` when client close.



-- 
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: commits-unsubscribe@pulsar.apache.org

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