Skip to content

Commit 449ec68

Browse files
Improve error logging for ShareConsumer commit_sync by detailing partition errors
1 parent 7d03a7f commit 449ec68

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

tests/soak/soakclient.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -480,13 +480,14 @@ def share_run(self):
480480
try:
481481
if use_sync:
482482
result = self.share_consumer.commit_sync(timeout=10.0)
483-
partition_errs = sum(
484-
1 for err in result.values() if err is not None
485-
)
486-
if partition_errs > 0:
483+
err_details = [
484+
"{}/{}={}".format(tp.topic, tp.partition, err)
485+
for tp, err in result.items() if err is not None
486+
]
487+
if err_details:
487488
self.logger.warning(
488-
"share: commit_sync had {} partition error(s)"
489-
.format(partition_errs)
489+
"share: commit_sync had {} partition error(s): {}"
490+
.format(len(err_details), "; ".join(err_details))
490491
)
491492
self.share_err_cnt += 1
492493
self.incr_counter("consumer.error", 1)

0 commit comments

Comments
 (0)