Skip to content

Commit

Permalink
sidecar: only log the first failure (#1026)
Browse files Browse the repository at this point in the history
Before we would reenable after successful calls so we could
detect if the sidecar was having periodic problems. However,
for UDP some calls can appear to be successful even if they
have failed so it still leads to spammy logs. For now limit
to the first failure.

Fixes #1025.
  • Loading branch information
brharrington authored Jan 10, 2023
1 parent 47860c4 commit 620b2a0
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,10 @@ void write(String line) {
try {
LOGGER.trace("writing to {}: {}", location, line);
writeImpl(line);
suppressWarnings = false;
} catch (IOException e) {
// Some writers such as the UDP writer can be quite noisy if the sidecar is not present.
// To avoid spamming the user with warnings, they will be suppressed after a warning is
// logged. Warnings will be re-enabled if there is a successful write so that if there
// are problems with a sidecar being intermittently accessible it will still get detected.
// logged. Note, in some cases UDP writes will fail without throwing an exception.
if (!suppressWarnings) {
LOGGER.warn("write to {} failed: {}", location, line, e);
suppressWarnings = true;
Expand Down

0 comments on commit 620b2a0

Please sign in to comment.