-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
XdsNameResolver and XdsServerWrapper don't check listener type #11737
Comments
Looks like the client receiving a socket listener will throw a NullPointerException, because grpc-java/xds/src/main/java/io/grpc/xds/XdsNameResolver.java Lines 661 to 663 in e8ff6da
|
But SocketListener is a non-api server side listener and it will never be used in XdsNameResolver! Isn't it so? XdsListenerResouce validates a check for non-api listener type. |
Yes, it isn't guaranteed. We expect a failure but we shouldn't trigger a NullPointerException. |
For the second part of this issue that it does not seem to follow gRFC A36. A simple conditional check with listenerAddress seems good enough. I believe we don't want to throw Exception from here, just marking it as not serving and logging the warning. Something like this in onChanged(LdsUpdate):
|
In general, it is really rare to pass an error along and log a warning. There can be some times in our server code because passing the error along is only ever seen by metrics. But here, the default |
Our resource parsing supports two listener types (I'm not confident enough validation is happening here):
grpc-java/xds/src/main/java/io/grpc/xds/XdsListenerResource.java
Lines 110 to 114 in 210f9c0
But XdsNameResolver and XdsServerWrapper don't check that they got the right type. No changes were made to XdsNameResolver when non-API listener type was allowed, so I doubt the logic exists but I'm just not seeing it.
I also don't see XdsServerWrapper call
address()
, so it appears it is not follow gRFC A36.The text was updated successfully, but these errors were encountered: