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

removed strict dns check for unknown keys #10285

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tonyjongyoonan
Copy link
Contributor

@tonyjongyoonan tonyjongyoonan commented Jun 15, 2023

#6579 describes a service config validation issue.

Specifically, the service config error handling proposal details that we should ignore unknown keys in our service config. This is consistent with the C and Go implementations.

However, a different proposal suggests that an unknown field should invalidate a service config.

This is a fix that is consistent with the former proposal (and the C and Go implementations) and ignores unknown keys in our service config.

(no consensus reached, on hold)

DnsNameResolver.maybeChooseServiceConfig(bad, new Random(), "host");
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add test cases about bad key behaviour if not already exist.

@YifeiZhuang
Copy link
Contributor

YifeiZhuang commented Jun 17, 2023

fixes #6579

cc. @ejona86

@@ -888,14 +888,13 @@ public HttpConnectProxiedSocketAddress proxyFor(SocketAddress targetAddress) {
}

@Test
public void maybeChooseServiceConfig_failsOnMisspelling() {
public void maybeChooseServiceConfig_nullOnMispelling() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should verify these all:

  1. A choice with a bad key + a valid key, the choice is chosen(non-null).
  2. A choice with only bad key, the choice is chosen.
  3. A choice missing service config + bad key, throw. (this test case)
  4. A choice missing service config + valid key, throw.

Also the test case name is not accurate.

@YifeiZhuang
Copy link
Contributor

The fix seems right to me but the test is incomplete.
This is helpful if you haven't read it yet https://github.com/grpc/proposal/blob/master/A21-service-config-error-handling.md#criteria-to-determine-the-validity-of-a-service-config
It helped to understand the problem.

@YifeiZhuang
Copy link
Contributor

This is put on hold until a cross language decision is made on #6579 (in about two weeks).

@tonyjongyoonan tonyjongyoonan changed the title removed strict dns check removed strict dns check for unknown keys Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DnsNameResolver seems overly strict when validating service config
2 participants