Skip to content

Commit

Permalink
Reduce duplicate logging in CallableImporter (#953)
Browse files Browse the repository at this point in the history
Summary:
Currently CallableImporter throws out an IOException if
IdempotentImportExecutor recorded errors. This IOExcpetion would be
printed to severe logging if the subsequent retry failed. However, the
content of the exception contains first error and error counts. And
these are already duplicatedly logged in IdempotentImportExecutor. This
cause logs to spam and hard to categorize errors.

This commit is to simplify that by removing the spamming part of the
log.

Test Plan: Ran and checked the log line

Reviewers: #dtp

Subscribers: 

Tasks: T81987523

Tags: 

Blame Revision: 


Differential Revision: https://phabricator.intern.facebook.com/D25995302
  • Loading branch information
Xiaomeng Zhang authored Jan 25, 2021
1 parent dabb7f4 commit a145e8f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ public ImportResult call() throws Exception {
success = result.getType() == ImportResult.ResultType.OK && errors.isEmpty();

if (!success) {
throw new IOException("Problem with importer, forcing a retry, "
+ errors.size() + " errors, first one: " +
(errors.iterator().hasNext() ? errors.iterator().next() : "none"));
// No need to log out individual errors
// since IdempotentImportExecutor already logs them out
throw new IOException(
"Encountered errors in idempotentImportExecutor, forcing a retry");
}

result = result.copyWithCounts(data.getCounts());
Expand Down

0 comments on commit a145e8f

Please sign in to comment.