Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xds: include node ID in RPC failure status messages from the XdsClient #9099

Merged
merged 3 commits into from Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions xds/src/main/java/io/grpc/xds/ClientXdsClient.java
Expand Up @@ -2538,9 +2538,8 @@ void onError(Status error) {
respTimer = null;
}

// Include node ID in RPC failure status messages that originate from XdsClient.
// We expect all watchers to propagate the description to the channel, and expose it
// to the caller.
// Include node ID in xds failures to allow cross-referencing with control plane logs
// when debugging.
String description = error.getDescription() == null ? "" : error.getDescription() + " ";
Status errorAugmented = Status.fromCode(error.getCode())
.withDescription(description + "nodeID: " + bootstrapInfo.node().getId())
Expand Down
6 changes: 6 additions & 0 deletions xds/src/main/java/io/grpc/xds/XdsClient.java
Expand Up @@ -398,6 +398,12 @@ interface ResourceWatcher {

/**
* Called when the resource discovery RPC encounters some transient error.
*
* <p>Note that we expect that the implementer to:
* - Override {@link Status} code with UNAVAILABLE to comply with the guarantee to not generate
sergiitk marked this conversation as resolved.
Show resolved Hide resolved
* certain statuses by the library: https://grpc.github.io/grpc/core/md_doc_statuscodes.html
* - Keep {@link Status} description in one form or another, as it contains valuable debugging
* information, such as node id.
sergiitk marked this conversation as resolved.
Show resolved Hide resolved
*/
void onError(Status error);

Expand Down