Skip to content

Commit 29115d5

Browse files
authored
MINOR: Don't print cleaning group metadata log if empty (apache#19080)
The new group coordinator prints the following line at fixed interval even if no groups were deleted: ``` Generated 0 tombstone records while cleaning up group metadata in 0 milliseconds. (org.apache.kafka.coordinator.group.GroupCoordinatorShard) ``` The time component has some value in its own but it may be better to not print if when there are not records in order to reduce the spam in the logs. Reviewers: Chia-Ping Tsai <[email protected]>
1 parent a6c53d0 commit 29115d5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorShard.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,11 @@ public CoordinatorResult<Void, CoordinatorRecord> cleanupGroupMetadata() {
753753
}
754754
});
755755

756-
log.info("Generated {} tombstone records while cleaning up group metadata in {} milliseconds.",
757-
records.size(), time.milliseconds() - startMs);
756+
if (!records.isEmpty()) {
757+
log.info("Generated {} tombstone records while cleaning up group metadata in {} milliseconds.",
758+
records.size(), time.milliseconds() - startMs);
759+
}
760+
758761
// Reschedule the next cycle.
759762
scheduleGroupMetadataExpiration();
760763
return new CoordinatorResult<>(records, false);

0 commit comments

Comments
 (0)