grpc / grpc/grpc-java

XdsClientImpl inconsistently includes nodeId

Open
#12,750 0 comments 0 reactions 1 assignee Claimed by @shivaspeaks View on GitHub
enhancement
Dominant language
Java
Stars
12.1k
Forks
4k
Avg merge
2d 17h
Merged PRs (30d)
37

Description

When creating https://github.com/grpc/grpc-java/pull/12749 I noticed that the error generated by XdsDependencyManager is:

```
Status{code=UNAVAILABLE, description=Error retrieving LDS resource the-service-name nodeID: node-id: NOT_FOUND: expected nodeID: node-id, cause=java.lang.IllegalArgumentException: a random exception...}
```

"nodeID: node-id" is repeated twice. XdsClientImpl adds it once, and XdsDependencyManager adds it again. XdsDependencyManager shouldn't be adding the node id from errors that come from XdsClient. But if you look at CdsLoadBalancer2Test from my PR, you'll see that "Timed out waiting for resource" errors _don't_ have node id duplicated.

XdsClientImpl includes node id in all results originating from ResourceSubscriber.onError(), but it doesn't from onAbsent() and addWatcher(). Apparently it also forgets the absent error details in addWatcher(). We need to fix onAbsent() and errorDescription, and probably save the absent error in lastError for later use in addWatcher(). At that point we can remove the node id from XdsDependencyManager (when it gets the error from xds client; if it generates the error itself, it may still need to include the node id).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.