Skip to content

Commit

Permalink
Merge pull request #1693 from alecgrieser/01692-remove-error-log
Browse files Browse the repository at this point in the history
Resolves #1692: Remove ERROR level log on failed no-ops
  • Loading branch information
MMcM committed May 24, 2022
2 parents f1ef0b3 + 7463ac8 commit d0e98a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/ReleaseNotes.md
Expand Up @@ -24,7 +24,7 @@ This release also updates downstream dependency versions. Most notably, the prot
* **Bug fix** Fix 2 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 3 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 4 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 5 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Failed no-ops no longer log at `ERROR` [(Issue #1692)](https://github.com/FoundationDB/fdb-record-layer/issues/1692)
* **Performance** Improvement 1 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Performance** Improvement 2 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Performance** Improvement 3 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
Expand Down
Expand Up @@ -479,13 +479,6 @@ public FDBRecordContext openContext(@Nonnull FDBRecordContextConfig contextConfi
return context;
}

private void logNoOpFailure(@Nonnull Throwable err) {
if (LOGGER.isErrorEnabled()) {
LOGGER.error(KeyValueLogMessage.of("unable to perform no-op operation against fdb",
LogMessageKeys.CLUSTER, getClusterFile()), err);
}
}

/**
* Perform a no-op against FDB to check network thread liveness. See {@link #performNoOp(Map, FDBStoreTimer)}
* for more information. This will use the default MDC for running threads and will not instrument the
Expand Down Expand Up @@ -551,17 +544,9 @@ public CompletableFuture<Void> performNoOpAsync(@Nullable Map<String, String> md
future = context.instrument(FDBStoreTimer.Events.PERFORM_NO_OP, future, startTime);
}
futureStarted = true;
return future.thenAccept(ignore -> { }).whenComplete((vignore, err) -> {
context.close();
if (err != null) {
logNoOpFailure(err);
}
});
return future.thenAccept(ignore -> { }).whenComplete((vignore, err) -> context.close());
} catch (RuntimeException e) {
logNoOpFailure(e);
CompletableFuture<Void> errFuture = new CompletableFuture<>();
errFuture.completeExceptionally(e);
return errFuture;
return CompletableFuture.failedFuture(e);
} finally {
if (!futureStarted) {
context.close();
Expand Down

0 comments on commit d0e98a7

Please sign in to comment.