Skip to content

Commit add6629

Browse files
rayokotaguozhangwang
authored andcommitted
MINOR: fix ProduceBenchWorker not to fail on final produce (apache#7254)
When sending bad records, the Trogdor task will fail if the final record produced is bad. Instead we should catch the exception to allow the task to finish since sending bad records is a valid use case. Reviewers: Tu V. Tran <tuvtran97@gmail.com>, Guozhang Wang <wangguoz@gmail.com>
1 parent 24547b8 commit add6629

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/src/main/java/org/apache/kafka/trogdor/workload/ProduceBenchWorker.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,11 @@ public Void call() throws Exception {
247247
throw e;
248248
} finally {
249249
if (sendFuture != null) {
250-
sendFuture.get();
250+
try {
251+
sendFuture.get();
252+
} catch (Exception e) {
253+
log.error("Exception on final future", e);
254+
}
251255
}
252256
producer.close();
253257
}

0 commit comments

Comments
 (0)