GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix potential DNS cache invalidation across different EventLoops by qnnn · Pull Request #14147 · netty/netty

Conversation

@qnnn

@qnnn qnnn commented Jun 28, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Motivation:

  • By default, DnsAddressResolverGroup sets up a separate DNSCache for each EventLoop. This can lead to cache invalidation when performing DNS resolution across different EventLoops due to the potential absence of cached DNS records.

Modification:

  • I propose initializing the DNSCache in DnsNameResolverBuilder during DnsAddressResolverGroup initialization to enable sharing of DNSCache among EventLoops under the same DnsAddressResolverGroup.

Add unit test: testSharedDNSCacheAcrossEventLoops

Fixes #14046.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
qnnn added 4 commits May 28, 2024 16:12
@qnnn
fix [14046] (#1)
cab2bc7
@qnnn
rename newCache、newCnameCache、newAuthoritativeDnsServerCache
9780064
@qnnn
Add unit test testSharedDNSCacheAcrossEventLoops
9fdf493
@qnnn
checkstyle
3ae6446
normanmaurer
normanmaurer requested changes Jul 1, 2024
View reviewed changes
Comment thread resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@qnnn @normanmaurer
Update resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolv…
5b330e6
…erTest.java

Co-authored-by: Norman Maurer <[email protected]>
@qnnn
qnnn requested a review from normanmaurer July 1, 2024 15:27
@normanmaurer normanmaurer added this to the 4.1.112.Final milestone Jul 5, 2024
normanmaurer
normanmaurer reviewed Jul 5, 2024
View reviewed changes
Comment thread resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@qnnn
Revert fix for ResolveWithDotSearchDomain scenario
6fc227d
@qnnn qnnn changed the title Fix potential DNS cache invalidation Fix potential DNS cache invalidation across different EventLoops Jul 7, 2024
@qnnn
qnnn requested a review from normanmaurer July 7, 2024 15:23
normanmaurer
normanmaurer requested changes Jul 9, 2024
View reviewed changes
Comment thread resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverBuilder.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverBuilder.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverBuilder.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
Apply suggestions from code review
bba1255
Mark as package-private
@qnnn
qnnn requested a review from normanmaurer July 9, 2024 12:54
@normanmaurer
normanmaurer requested review from bryce-anderson and idelpivnitskiy July 10, 2024 17:58
bryce-anderson
bryce-anderson approved these changes Jul 10, 2024
View reviewed changes

@bryce-anderson bryce-anderson left a comment

Copy link
Copy Markdown
Contributor

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.

This seems reasonable to me but I'm not an expert in this code so please head the advice of others. 🙂

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread resolver-dns/src/main/java/io/netty/resolver/dns/DnsAddressResolverGroup.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer @bryce-anderson
Update resolver-dns/src/main/java/io/netty/resolver/dns/DnsAddressRes…
956333f
…olverGroup.java

Co-authored-by: Bryce Anderson <[email protected]>
@normanmaurer

normanmaurer commented Jul 11, 2024

Copy link
Copy Markdown
Member

@qnnn I merged the commit of @bryce-anderson ... please do all remaining changes and ping me once done

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@qnnn
Apply suggestions from code review
9fef978
@qnnn

qnnn commented Jul 11, 2024

Copy link
Copy Markdown
Contributor Author

@qnnn I merged the commit of @bryce-anderson ... please do all remaining changes and ping me once done

@normanmaurer Thanks! I've completed the remaining changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer
normanmaurer approved these changes Jul 11, 2024
View reviewed changes
idelpivnitskiy
idelpivnitskiy approved these changes Jul 11, 2024
View reviewed changes
@normanmaurer
normanmaurer merged commit d05af24 into netty:4.1 Jul 11, 2024
@normanmaurer

normanmaurer commented Jul 11, 2024

Copy link
Copy Markdown
Member

@qnnn thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer added a commit that referenced this pull request Jul 11, 2024
@qnnn @normanmaurer @bryce-anderson
Fix potential DNS cache invalidation across different EventLoops (#14147
5fa29ce
)

Motivation:

By default, `DnsAddressResolverGroup` sets up a separate `DNSCache`
for each `EventLoop`. This can lead to cache invalidation when
performing DNS resolution across different EventLoops due to the
potential absence of cached DNS records.

Modification:

- initializing the DNSCache in `DnsNameResolverBuilder` during
`DnsAddressResolverGroup` initialization to enable sharing of DNSCache
among EventLoops under the same `DnsAddressResolverGroup`.
- Add unit test: testSharedDNSCacheAcrossEventLoops

Result:

Fixes #14046.

---------

Co-authored-by: Norman Maurer <[email protected]>
Co-authored-by: Bryce Anderson <[email protected]>
normanmaurer added a commit that referenced this pull request Jul 11, 2024
@qnnn @normanmaurer @bryce-anderson
Fix potential DNS cache invalidation across different EventLoops (#14147
3b1fa58
)

Motivation:

By default, `DnsAddressResolverGroup` sets up a separate `DNSCache`
for each `EventLoop`. This can lead to cache invalidation when
performing DNS resolution across different EventLoops due to the
potential absence of cached DNS records.

Modification:

- initializing the DNSCache in `DnsNameResolverBuilder` during
`DnsAddressResolverGroup` initialization to enable sharing of DNSCache
among EventLoops under the same `DnsAddressResolverGroup`.
- Add unit test: testSharedDNSCacheAcrossEventLoops

Result:

Fixes #14046.

---------

Co-authored-by: Norman Maurer <[email protected]>
Co-authored-by: Bryce Anderson <[email protected]>
@idelpivnitskiy idelpivnitskiy mentioned this pull request Sep 26, 2024
Refactor DnsNameResolver to be able to use different strategies when … #14374
Merged
This was referenced Sep 14, 2026
Http2: Reserve promised stream for PUSH_PROMISE after local RST_STREAM #17471
Closed
cache failure 1233e4a5 #17565
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@normanmaurer normanmaurer normanmaurer approved these changes
@bryce-anderson bryce-anderson bryce-anderson approved these changes
@idelpivnitskiy idelpivnitskiy idelpivnitskiy approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.1.112.Final

Development

Successfully merging this pull request may close these issues.

DNSResolve: DNS Cache Not Working in Certain Scenarios

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@qnnn @normanmaurer @bryce-anderson @idelpivnitskiy
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.