mirror of https://github.com/grpc/grpc-java.git
xds: Include unknown type in channel logger warning
This makes the log statement more useful and easier to determine whether this was expected behavior.
This commit is contained in:
parent
82ca98f338
commit
ce86090322
|
@ -301,13 +301,12 @@ final class AbstractXdsClient {
|
|||
|
||||
final void handleRpcResponse(XdsResourceType<?> type, String versionInfo, List<Any> resources,
|
||||
String nonce) {
|
||||
checkNotNull(type, "type");
|
||||
if (closed) {
|
||||
return;
|
||||
}
|
||||
responseReceived = true;
|
||||
if (type != null) {
|
||||
respNonces.put(type, nonce);
|
||||
}
|
||||
xdsResponseHandler.handleResourceResponse(type, serverInfo, versionInfo, resources, nonce);
|
||||
}
|
||||
|
||||
|
@ -391,6 +390,13 @@ final class AbstractXdsClient {
|
|||
XdsLogLevel.DEBUG, "Received {0} response:\n{1}", type,
|
||||
MessagePrinter.print(response));
|
||||
}
|
||||
if (type == null) {
|
||||
logger.log(
|
||||
XdsLogLevel.WARNING,
|
||||
"Ignore an unknown type of DiscoveryResponse: {0}",
|
||||
response.getTypeUrl());
|
||||
return;
|
||||
}
|
||||
handleRpcResponse(type, response.getVersionInfo(), response.getResourcesList(),
|
||||
response.getNonce());
|
||||
}
|
||||
|
|
|
@ -167,11 +167,8 @@ final class XdsClientImpl extends XdsClient
|
|||
public void handleResourceResponse(
|
||||
XdsResourceType<?> xdsResourceType, ServerInfo serverInfo, String versionInfo,
|
||||
List<Any> resources, String nonce) {
|
||||
checkNotNull(xdsResourceType, "xdsResourceType");
|
||||
syncContext.throwIfNotInThisSynchronizationContext();
|
||||
if (xdsResourceType == null) {
|
||||
logger.log(XdsLogLevel.WARNING, "Ignore an unknown type of DiscoveryResponse");
|
||||
return;
|
||||
}
|
||||
Set<String> toParseResourceNames = null;
|
||||
if (!(xdsResourceType == XdsListenerResource.getInstance()
|
||||
|| xdsResourceType == XdsRouteConfigureResource.getInstance())
|
||||
|
|
Loading…
Reference in New Issue