-
Notifications
You must be signed in to change notification settings - Fork 645
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
fix: support authority overrides in the DNS resolver #2776
Merged
murgatroid99
merged 12 commits into
grpc:master
from
gkampitakis:gkampitakis/patch_dns_lookup
Jul 10, 2024
+114
−24
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e2a93d1
fix: support authority overrides in the DNS resolver
gkampitakis c3d073b
update per comments
gkampitakis 6278da6
support selecting resolver via env
gkampitakis 7f27b32
resolve both ipv4 and ipv6
gkampitakis cb58fbc
fix: use GRPC_NODE_USE_ALTERNATIVE_RESOLVER for enabling new alternat…
gkampitakis c9fc8b2
fix import node:dns promises
gkampitakis 717725c
chore: update environment.md doc
gkampitakis f0afe69
add tests for test-resolver with alternative resolver
gkampitakis 2a9f8f4
address comments for testing
gkampitakis 3aaf0c6
reject lookup when all resolutions reject
gkampitakis a9aea45
reset process env and add trace log
gkampitakis 201595c
run tests in series
gkampitakis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright 2024 gRPC authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
export const GRPC_NODE_USE_ALTERNATIVE_RESOLVER = | ||
(process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER ?? 'false') === 'true'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I think this is impacting other test jobs. I think this alternative will work: create a new file called something like
alternate-resolver.env
that just saysGRPC_NODE_USE_ALTERNATIVE_RESOLVER=true
and add an option in themocha
command a couple of lines down that saysnodeOption: 'env-file=alternate-resolver.env'
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are referring to this, I don't see a
nodeOption
or something similar from the documentation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what I'm talking about. The gulp-mocha documentation says
The mocha command line options documentation includes this line:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think currently it will be hard to tell whether that actually worked, so it would be a good idea to add something like this in the DNS resolver constructor:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the node
--env-file
was added only on node 20 though right? will it work with the CI running on 14 and 16?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, that probably won't work. So, here's another alternative: add another target that just sets
process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER = 'false';
and add it to the end of thetest
series.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I don't think this quite works because at the top level, the test suites are run in parallel. I think changing this line to run in series should fix it.