-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: Delete check for router filter being last in config selector #6259
Comments
thanks @easwars, I'll get started on this |
hi @easwars
however I'm still trying to figure out how to write the testcase for it the I found this testcase corresponding to the would you happen to have any pointers for me on how to do this? |
If you scroll all the way to the bottom of And you would have to add a test case for both the client ( Hope this helps. |
Thank you, this is really helpful |
I thought that was the only test case to add. What other cases were you planning to add? |
Is there an issue with checking that the last filter is in fact the router filter and not just any terminal filter? |
Currently the config selector is checking if the last filter is the router filter, which doesn't seem like the correct place to have that check. If we at all should have that check, it should be in the xds client. |
I don't see an issue with an explicit check for the router filter. However, if what I mentioned earlier was correct (router is only terminal filter), router filter -> terminal filter, so the check does technically encapsulate "in face the router filter" and not "any terminal filter" |
hi @easwars However I was going through the actual tests which use those existing types and found that the filter chains in those tests in fact add a
Now these Router type filters (i.e. Hence I think we could modify Then we just need to create one new |
@Aditya-Sood : Sounds good. |
Raised #6281 for the Router filter check Also regarding the
Shall I create test cases for this as well in a separate PR? |
router
filter is the last filter in the chain
As per discussion on #6281 and #6248, the xDS Client handling of this is correct and what the gRPC team designed. However, we have a trailing check in config selector that needs to be deleted from the deleted part in the gRFC. It is a currently a no-op, since emissions from the client will have router filter as last filter in chain, but it still is a cleanup that can be done. |
@zasweq could you confirm if this is the cleanup you are referring to be done as part of this PR? |
hi @zasweq @easwars |
Yeah, that is :). Closing this issue. |
gRFC A39 talks about gRPC's support for xDS HTTP filters. This gRFC was amended as part of PR 250. While we ended up implementing most of the changes mentioned in the amendment, we failed to implement the config time validation check to ensure that an LDS resource contains the
router
filter as the last filter.HTTP filters received as part of an LDS resource are processed in this function:
grpc-go/xds/internal/xdsclient/xdsresource/unmarshal_lds.go
Line 195 in 417cf84
While we do validate that the filter chain is not empty and that the last filter in the chain is a terminal filter, we are not currently validating that the last filter is in-fact the
router
filter.The
router
filter package does provide a utility function to check if a filter is therouter
filter:grpc-go/xds/internal/httpfilter/router/router.go
Line 42 in 417cf84
We can use that function here to ensure that the
router
filter is present in the list and that it is the last filter in the list.The text was updated successfully, but these errors were encountered: