Skip to content

Commit 68a7a9b

Browse files
authored
Suppress LeaseAssignmentManager excessive WARN logs when there is no issue (#1437)
This commit fixes #1407. The WARN level log statements should only be executed when a real problem had been detected.
1 parent ae9a433 commit 68a7a9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/assignment/LeaseAssignmentManager.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,8 @@ public void loadInMemoryStorageView(final MetricsScope metricsScope) throws Exce
537537
.filter(workerMetrics -> !workerMetrics.isValidWorkerMetric())
538538
.map(WorkerMetricStats::getWorkerId)
539539
.collect(Collectors.toList());
540-
log.warn("List of workerIds with invalid entries : {}", listOfWorkerIdOfInvalidWorkerMetricsEntry);
541540
if (!listOfWorkerIdOfInvalidWorkerMetricsEntry.isEmpty()) {
541+
log.warn("List of workerIds with invalid entries : {}", listOfWorkerIdOfInvalidWorkerMetricsEntry);
542542
metricsScope.addData(
543543
"NumWorkersWithInvalidEntry",
544544
listOfWorkerIdOfInvalidWorkerMetricsEntry.size(),
@@ -567,8 +567,8 @@ public void loadInMemoryStorageView(final MetricsScope metricsScope) throws Exce
567567

568568
final Map.Entry<List<Lease>, List<String>> leaseListResponse = leaseListFuture.join();
569569
this.leaseList = leaseListResponse.getKey();
570-
log.warn("Leases that failed deserialization : {}", leaseListResponse.getValue());
571570
if (!leaseListResponse.getValue().isEmpty()) {
571+
log.warn("Leases that failed deserialization : {}", leaseListResponse.getValue());
572572
MetricsUtil.addCount(
573573
metricsScope,
574574
"LeaseDeserializationFailureCount",

0 commit comments

Comments
 (0)