Skip to content

Auto-port 5.0: Add BlockHound exception for DnsQueryIdSpace - #16906

Merged
chrisvest merged 1 commit into
5.0from
auto-port-pr-16896-to-5.0
Jun 5, 2026
Merged

chrisvest merged 1 commit into
5.0from
auto-port-pr-16896-to-5.0

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #16896 to 5.0
Cherry-picked commit: d0957df


Motivation:
DnsQueryIdSpace uses SecureRandom.nextBytes.
This can call java.io.FileInputStream#readBytes, which triggers a BlockingOperationError when BlockHound is enabled.

Modification:

  • Allow blocking calls in DnsQueryIdSpace#nextId and DnsQueryIdSpace$DnsQueryIdRange#pushId.
  • Add testDnsNameResolverAllowsBlockingCalls to verify that DnsNameResolver does not trigger BlockHound exceptions.

Result:
No BlockHound exceptions during DNS resolution.

Motivation:
DnsQueryIdSpace uses SecureRandom.nextBytes.
This can call java.io.FileInputStream#readBytes, which triggers a
BlockingOperationError when BlockHound is enabled.

Modification:
- Allow blocking calls in DnsQueryIdSpace#nextId and
DnsQueryIdSpace$DnsQueryIdRange#pushId.
- Add testDnsNameResolverAllowsBlockingCalls to verify that
DnsNameResolver does not trigger BlockHound exceptions.

Result:
No BlockHound exceptions during DNS resolution.

(cherry picked from commit d0957df)
@chrisvest chrisvest added this to the 5.0.0.Final milestone Jun 4, 2026
@chrisvest
chrisvest merged commit cbe0e11 into 5.0 Jun 5, 2026
11 of 13 checks passed
@chrisvest
chrisvest deleted the auto-port-pr-16896-to-5.0 branch June 5, 2026 17:31
@normanmaurer normanmaurer mentioned this pull request Sep 22, 2026
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.

3 participants