kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maniku...@apache.org
Subject [kafka] branch trunk updated: MINOR: Fix ProducerPerformance bug when numRecords > Integer.MAX (#5956)
Date Thu, 29 Nov 2018 06:49:06 GMT
This is an automated email from the ASF dual-hosted git repository.

manikumar pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 4fb5520  MINOR: Fix ProducerPerformance bug when numRecords > Integer.MAX (#5956)
4fb5520 is described below

commit 4fb5520901d9908d2ca16b6f56242b778f6d2f05
Author: seayoun <45163307+seayoun@users.noreply.github.com>
AuthorDate: Thu Nov 29 14:48:56 2018 +0800

    MINOR: Fix ProducerPerformance bug when numRecords > Integer.MAX (#5956)
    
    Current code will fall into non-stop loop and send more message to broker, and Stat in
PerfCallback method record will throw ArrayIndexOutOfBoundsException
---
 tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java b/tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java
index 400231e..6dba510 100644
--- a/tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java
+++ b/tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java
@@ -126,7 +126,7 @@ public class ProducerPerformance {
 
             int currentTransactionSize = 0;
             long transactionStartTime = 0;
-            for (int i = 0; i < numRecords; i++) {
+            for (long i = 0; i < numRecords; i++) {
                 if (transactionsEnabled && currentTransactionSize == 0) {
                     producer.beginTransaction();
                     transactionStartTime = System.currentTimeMillis();


Mime
View raw message