Skip to content

Commit

Permalink
Merge pull request #25073: Improves StorageWrite API error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
prodriguezdefino authored Jan 19, 2023
1 parent 1c4e424 commit 876ce5b
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ long flush(
}

LOG.warn(
"Append to stream {} by client #{} failed with error, operations will be retried. Details: {}",
"Append to stream {} by client #{} failed with error, operations will be retried.\n{}",
streamName,
clientNumber,
retrieveErrorDetails(contexts));
Expand All @@ -510,8 +510,13 @@ String retrieveErrorDetails(Iterable<AppendRowsContext> failedContext) {
return StreamSupport.stream(failedContext.spliterator(), false)
.<@Nullable Throwable>map(AppendRowsContext::getError)
.filter(err -> err != null)
.flatMap(thrw -> Arrays.stream(Preconditions.checkStateNotNull(thrw).getStackTrace()))
.map(StackTraceElement::toString)
.map(
thrw ->
Preconditions.checkStateNotNull(thrw).toString()
+ "\n"
+ Arrays.stream(Preconditions.checkStateNotNull(thrw).getStackTrace())
.map(StackTraceElement::toString)
.collect(Collectors.joining("\n")))
.collect(Collectors.joining("\n"));
}
}
Expand Down

0 comments on commit 876ce5b

Please sign in to comment.