Skip to content

Add support for DNSCacheManager - #158

Merged
3dgiordano merged 1 commit into
developmentfrom
DNS-CACHE-MANAGER
Aug 21, 2026
Merged

Add support for DNSCacheManager#158
3dgiordano merged 1 commit into
developmentfrom
DNS-CACHE-MANAGER

Conversation

@3dgiordano

Copy link
Copy Markdown
Collaborator

This pull request adds support for using JMeter's DNS Cache Manager in the HTTP plugin, ensuring that custom DNS resolution (such as static host entries and custom DNS servers) applies to HTTP requests just as it does for the HTTPHC4 sampler. The changes also ensure that DNS resolution is properly isolated per sampler and per thread, preventing cross-contamination between samplers with different DNS configurations. Comprehensive tests are included to verify correct integration and behavior.

DNS resolution integration and isolation:

  • Added a new JMeterDnsSocketAddressResolver class that adapts JMeter's DNSCacheManager (via DnsResolver) for use by Jetty's HttpClient, ensuring all protocol variants (HTTP/1.1, HTTP/2, HTTP/3) resolve hosts through the DNS Cache Manager when configured.
  • Modified HTTP2JettyClient to accept a DnsResolver in its constructor, store it, and install the custom resolver on each protocol client during configuration. [1] [2] [3] [4]
  • Updated HTTP2Sampler to pass the correct DNS resolver to HTTP2JettyClient and to ensure the client cache key includes the DNS Cache Manager instance, preventing clients from being shared across samplers with different DNS configurations. [1] [2] [3]

Testing and verification:

  • Added a new test class HTTP2JettyClientDnsCacheManagerTest to verify that the DNS Cache Manager is correctly installed, that static host entries are respected, that proxy resolution targets the proxy host, and that client cache keys are isolated by DNS manager instance.

@3dgiordano
3dgiordano merged commit 67c0d05 into development Aug 21, 2026
2 checks passed
@3dgiordano
3dgiordano deleted the DNS-CACHE-MANAGER branch August 21, 2026 17:19
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.

1 participant