Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public <R> boolean schedule(
"the coordinator is not active.", key, exception.getMessage());
} else {
log.error("The write event for the task {} failed due to {}. Ignoring it. ",
key, exception.getMessage());
key, exception.getMessage(), exception);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public void run() {
schedule(key, retryBackoff, TimeUnit.MILLISECONDS, true, retryBackoff, operation);
} else {
log.error("The write event {} for the timer {} failed due to {}. Ignoring it. ",
event.name, key, ex.getMessage());
event.name, key, ex.getMessage(), ex);
}

return null;
Expand Down Expand Up @@ -717,7 +717,7 @@ private void load() {
}
} catch (Throwable ex) {
log.error("Failed to load metadata from {} with epoch {} due to {}.",
tp, epoch, ex.toString());
tp, epoch, ex.toString(), ex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the whole exception ex is logged, changing ex.toString() to ex.getMessage() would eliminate a lot of redundant information in the log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing! I've updated the PR to use getMessage instead.

context.transitionTo(CoordinatorState.FAILED);
}
} else {
Expand Down Expand Up @@ -820,7 +820,7 @@ private void flushCurrentBatch() {
// Free up the current batch.
freeCurrentBatch();
} catch (Throwable t) {
log.error("Writing records to {} failed due to: {}.", tp, t.getMessage());
log.error("Writing records to {} failed due to: {}.", tp, t.getMessage(), t);
failCurrentBatch(t);
// We rethrow the exception for the caller to handle it too.
throw t;
Expand Down Expand Up @@ -1057,7 +1057,7 @@ private void append(
currentBatch.builder.append(recordToAppend);
currentBatch.nextOffset++;
} catch (Throwable t) {
log.error("Replaying record {} to {} failed due to: {}.", recordToReplay, tp, t.getMessage());
log.error("Replaying record {} to {} failed due to: {}.", recordToReplay, tp, t.getMessage(), t);

// Add the event to the list of pending events associated with the last
// batch in order to fail it too.
Expand Down Expand Up @@ -2446,7 +2446,7 @@ public void scheduleUnloadOperation(
// It's very unlikely that we will ever see an exception here, since we
// already make an effort to catch exceptions in the unload method.
log.error("Failed to unload metadata for {} with epoch {} due to {}.",
tp, partitionEpoch, ex.toString());
tp, partitionEpoch, ex.toString(), ex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

} finally {
// Always remove the coordinator context, otherwise the coordinator
// shard could be permanently stuck.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ private CompletableFuture<DescribeShareGroupOffsetsResponseData.DescribeShareGro
persister.readSummary(ReadShareGroupStateSummaryParameters.from(readSummaryRequestData))
.whenComplete((result, error) -> {
if (error != null) {
log.error("Failed to read summary of the share partition");
log.error("Failed to read summary of the share partition", error);
future.completeExceptionally(error);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3418,7 +3418,7 @@ private CoordinatorResult<Void, CoordinatorRecord> handleRegularExpressionsResul
) {
if (exception != null) {
log.error("[GroupId {}] Couldn't update regular expression due to: {}",
groupId, exception.getMessage());
groupId, exception.getMessage(), exception);
return new CoordinatorResult<>(List.of());
}

Expand Down Expand Up @@ -3894,7 +3894,7 @@ private Assignment updateTargetAssignment(
} catch (PartitionAssignorException ex) {
String msg = String.format("Failed to compute a new target assignment for epoch %d: %s",
groupEpoch, ex.getMessage());
log.error("[GroupId {}] {}.", group.groupId(), msg);
log.error("[GroupId {}] {}.", group.groupId(), msg, ex);
throw new UnknownServerException(msg, ex);
}
}
Expand Down Expand Up @@ -3955,7 +3955,7 @@ private Assignment updateTargetAssignment(
} catch (PartitionAssignorException ex) {
String msg = String.format("Failed to compute a new target assignment for epoch %d: %s",
groupEpoch, ex.getMessage());
log.error("[GroupId {}] {}.", group.groupId(), msg);
log.error("[GroupId {}] {}.", group.groupId(), msg, ex);
throw new UnknownServerException(msg, ex);
}
}
Expand Down Expand Up @@ -4014,7 +4014,7 @@ private TasksTuple updateStreamsTargetAssignment(
} catch (TaskAssignorException ex) {
String msg = String.format("Failed to compute a new target assignment for epoch %d: %s",
groupEpoch, ex.getMessage());
log.error("[GroupId {}] {}.", group.groupId(), msg);
log.error("[GroupId {}] {}.", group.groupId(), msg, ex);
throw new UnknownServerException(msg, ex);
}
}
Expand Down