Skip to content
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

Support IPV6_ADDR_PREFERENCES until Java 24 and beyond #1007

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

bertm
Copy link
Contributor

@bertm bertm commented Nov 19, 2024

While reflection on Java's internals is slowly being crippled, Unsafe access is still possible (at least until JEP 417 [0] reaches phase 3 in Java 26 or later).

This requires moving from DatagramSocket to DatagramChannel as the former is substantially rewritten in Java 15 (JEP 373, see [1]) as a wrapper around the latter. The channel-based socket cannot be used in Java versions prior to 14 due to Java bug JDK-8232673 [2] which prevents read/write concurrency, effectively stalling the node.

Tested on OpenJDK 8, 11, 17, 21, 23, and 24.
Fixes bug 07217.

[0] https://openjdk.org/jeps/471
[1] https://openjdk.org/jeps/373
[2] https://bugs.openjdk.org/browse/JDK-8232673

While reflection on Java's internals is slowly being crippled, Unsafe
access is still possible (at least until JEP 417 [0] reaches phase 3 in
Java 26 or later).

This requires moving from DatagramSocket to DatagramChannel as the
former is substantially rewritten in Java 15 (JEP 373, see [1]) as a
wrapper around the latter. The channel-based socket cannot be used in
Java versions prior to 14 due to Java bug JDK-8232673 [2] which prevents
read/write concurrency, effectively stalling the node.

Tested on OpenJDK 8, 11, 17, 21, 23, and 24.
Fixes bug 07217.

[0] https://openjdk.org/jeps/471
[1] https://openjdk.org/jeps/373
[2] https://bugs.openjdk.org/browse/JDK-8232673
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