-
Notifications
You must be signed in to change notification settings - Fork 761
Managed implementation of DNS resolver #6104
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
2c217a3
First integration of Resolver sources
rzikm 704e33c
Allow mocking
rzikm aff6d17
Fix dispose
rzikm 15db8a1
Fix tests
rzikm 6bda235
Actually run ResolvConf tests
rzikm 6fc61e0
Add retry functionality
rzikm 2b6d91e
Add logging
rzikm 2137954
Fix Microsoft.Extensions.ServiceDiscovery.Yarp.Tests
rzikm c204b01
Merge remote-tracking branch 'upstream/main' into managed-resolver
rzikm 2fc7de4
Activity WIP
rzikm 9b4de29
Fix reading CNAME with pointers in domain name segments
rzikm 3ad5a75
Reenable telemetry
rzikm 40f8f9b
Last changes to telemetry
rzikm e385605
Use strong RNG for Transaction ID generation
rzikm 3cf0a9d
Check against too long domain name
rzikm 6016e41
Disallow pointer to pointer.
rzikm f8c189d
Code review feedback (easy fixes)
rzikm d929889
More code review feedback
rzikm 00e41d7
Fix increment
rzikm 7267fb7
Detect CNAME loops
rzikm c1b76d3
Handle empty Tcp fallback responses and lack of TCP failover support …
rzikm 86490cc
Dispose result.Response when overwritten by another result.
rzikm 92b2905
Move DnsMessageHeader parsing to DnsPrimitives
rzikm fdf1904
Rework and add tests to retries and failover
rzikm 61814e7
Test failover after exhausting attempts on one server
rzikm 82a8108
Streamline options, remove unsupported options from ResolverOptions
rzikm fa627fd
Better handling of malformed responses
rzikm 4ec79ca
Code review feedback
rzikm 123375d
More feedback
rzikm 6311616
Guarantee linear parsing of CNAME chains
rzikm c57a8c5
Fix decoding compressed CNAME in TCP fallback
rzikm 83ca958
More code coverage
rzikm 03e6a99
Correctly handle IDN names
rzikm 46418fe
Minor fixes
rzikm 4075e4f
Add Fuzzing tests for DNS resolver
rzikm 56cd169
Improve fuzzing of EncodedDomainName
rzikm a19e8a2
Merge remote-tracking branch 'upstream/main' into managed-resolver
rzikm 5d5edae
Remove commented out code
rzikm 3c387e9
Fix build
rzikm c6e3d63
Fix Yarp service discovery tests
rzikm e66229a
Lazy TCP socket allocation in LoopbackTests
rzikm da018f7
LoopbackTestBaseLogging
rzikm 2697412
fixup! LoopbackTestBaseLogging
rzikm 214cc9b
Downgrade SharpFuzz
rzikm 0d891cb
Fix buffer use after returning to pool
rzikm 46cf262
Merge branch 'main' into managed-resolver
rzikm 35a5809
Fix build
rzikm fcf18cf
Merge branch 'main' into managed-resolver
rzikm df785d1
Remove DnsClient package ref
rzikm 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
Add logging
- Loading branch information
commit 2b6d91e9494e8ae2f75f9d7be3e9f2428e2a296f
There are no files selected for viewing
This file contains hidden or 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
30 changes: 30 additions & 0 deletions
30
src/Microsoft.Extensions.ServiceDiscovery.Dns/Resolver/DnsResolver.Log.cs
This file contains hidden or 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,30 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| using System.Net; | ||
| using Microsoft.Extensions.Logging; | ||
|
|
||
| namespace Microsoft.Extensions.ServiceDiscovery.Dns.Resolver; | ||
|
|
||
| internal partial class DnsResolver : IDnsResolver, IDisposable | ||
| { | ||
| internal static partial class Log | ||
| { | ||
| [LoggerMessage(1, LogLevel.Information, "Resolving {QueryType} {QueryName} on {Server} attempt {Attempt}", EventName = "Query")] | ||
| public static partial void Query(ILogger logger, QueryType queryType, string queryName, IPEndPoint server, int attempt); | ||
|
|
||
| [LoggerMessage(2, LogLevel.Debug, "Result truncated for {QueryType} {QueryName} from {Server} attempt {Attempt}. Restarting over TCP", EventName = "ResultTruncated")] | ||
| public static partial void ResultTruncated(ILogger logger, QueryType queryType, string queryName, IPEndPoint server, int attempt); | ||
|
|
||
| [LoggerMessage(3, LogLevel.Error, "Server {Server} replied with {ResponseCode} when querying {QueryType} {QueryName}", EventName = "ErrorResponseCode")] | ||
| public static partial void ErrorResponseCode(ILogger logger, QueryType queryType, string queryName, IPEndPoint server, QueryResponseCode responseCode); | ||
|
|
||
| [LoggerMessage(4, LogLevel.Information, "Query {QueryType} {QueryName} on {Server} attempt {Attempt} timed out.", EventName = "Timeout")] | ||
| public static partial void Timeout(ILogger logger, QueryType queryType, string queryName, IPEndPoint server, int attempt); | ||
|
|
||
| [LoggerMessage(5, LogLevel.Warning, "Query {QueryType} {QueryName} on {Server} attempt {Attempt} returned no data", EventName = "NoData")] | ||
| public static partial void NoData(ILogger logger, QueryType queryType, string queryName, IPEndPoint server, int attempt); | ||
|
|
||
| [LoggerMessage(6, LogLevel.Error, "Query {QueryType} {QueryName} on {Server} attempt {Attempt} failed.", EventName = "QueryError")] | ||
| public static partial void QueryError(ILogger logger, QueryType queryType, string queryName, IPEndPoint server, int attempt, Exception exception); | ||
| } | ||
| } |
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.