Skip to content

Commit

Permalink
Add Central Dogma to client's warn, error messages (line#466)
Browse files Browse the repository at this point in the history
Motivation:
We have been informed that Central Dogma message itself is indistinguishable from other messages.

```
Failed to watch a file (/path/to/file); trying again
```

Modification:
* Add `Central Dogma` to client warn and error messages

Result:
A user can easily distinguish Central Dogma client warn and error log messages from other messages
  • Loading branch information
ikhoon authored and trustin committed Dec 12, 2019
1 parent 5b2dc02 commit bdb4e48
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ private void registerWatcher() {
}
setEndpoints(newEndpoints);
} catch (Exception e) {
logger.warn("Failed to refresh the endpoint list.", e);
logger.warn("Failed to re-retrieve the endpoint list from Central Dogma.", e);
}
});
instanceListWatcher.initialValueFuture().exceptionally(e -> {
logger.warn("Failed to initialize instance list.", e);
logger.warn("Failed to retrieve the initial instance list from Central Dogma.", e);
return null;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,13 @@ private void doWatch(int numAttemptsSoFar) {
}

if (!logged) {
logger.warn("Failed to watch a file ({}/{}{}); trying again",
logger.warn("Failed to watch a file ({}/{}{}) at Central Dogma; trying again",
projectName, repositoryName, pathPattern, cause);
}

scheduleWatch(numAttemptsSoFar + 1);
} catch (Throwable t) {
logger.error("Unexpected exception while watching a file:", t);
logger.error("Unexpected exception while watching a file at Central Dogma:", t);
}
return null;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,12 @@ private <T> CompletableFuture<T> executeWithRetries(
if (!retryRequired || nextAttemptsSoFar > maxRetries) {
if (retryRequired) {
if (currentReplicaHint != null) {
logger.warn("[{}] Failed to retrieve the up-to-date data after {} retries: {} => {}",
logger.warn("[{}] Failed to retrieve the up-to-date data from Central Dogma " +
"after {} retries: {} => {}",
currentReplicaHint, attemptsSoFar, taskRunner, resultOrCause(res, cause));
} else {
logger.warn("Failed to retrieve the up-to-date data after {} retries: {} => {}",
logger.warn("Failed to retrieve the up-to-date data from Central Dogma " +
"after {} retries: {} => {}",
attemptsSoFar, taskRunner, resultOrCause(res, cause));
}
} else if (logger.isDebugEnabled()) {
Expand Down

0 comments on commit bdb4e48

Please sign in to comment.