Skip to content

8373704: Improve "SocketException: Protocol family unavailable" message#28851

Closed
MBaesken wants to merge 2 commits intoopenjdk:masterfrom
MBaesken:JDK-8373704
Closed

8373704: Improve "SocketException: Protocol family unavailable" message#28851
MBaesken wants to merge 2 commits intoopenjdk:masterfrom
MBaesken:JDK-8373704

Conversation

@MBaesken
Copy link
Member

@MBaesken MBaesken commented Dec 16, 2025

In JDK-8373676
we noticed a "SocketException: Protocol family unavailable" because of missing ipv6 support. We could improve this exception and tell that the ipv6 support is not available or something related.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8373704: Improve "SocketException: Protocol family unavailable" message (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28851/head:pull/28851
$ git checkout pull/28851

Update a local copy of the PR:
$ git checkout pull/28851
$ git pull https://git.openjdk.org/jdk.git pull/28851/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28851

View PR using the GUI difftool:
$ git pr show -t 28851

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28851.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 16, 2025

👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 16, 2025

@MBaesken This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8373704: Improve "SocketException: Protocol family unavailable" message

Reviewed-by: lucy, jpai

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 132 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title JDK-8373704: Improve "SocketException: Protocol family unavailable" message 8373704: Improve "SocketException: Protocol family unavailable" message Dec 16, 2025
@openjdk openjdk bot added the net net-dev@openjdk.org label Dec 16, 2025
@openjdk
Copy link

openjdk bot commented Dec 16, 2025

@MBaesken The following label will be automatically applied to this pull request:

  • net

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 16, 2025
@mlbridge
Copy link

mlbridge bot commented Dec 16, 2025

Webrevs

Copy link
Contributor

@RealLucy RealLucy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 1, 2026
@AlanBateman
Copy link
Contributor

we noticed a "SocketException: Protocol family unavailable" because of missing ipv6 support. We could improve this exception and tell that the ipv6 support is not available or something related.

Would it be possible to say which method or test failure lead to this? I'm wondering how we end up calling it with an IPv6 address when not supported.

@MBaesken
Copy link
Member Author

MBaesken commented Jan 2, 2026

Hi Alan, it was the test javax/net/ssl/HttpsURLConnection/SubjectAltNameIP.java .
See https://bugs.openjdk.org/browse/JDK-8373676 .

Error :
command: main SubjectAltNameIP [::1]
reason: User specified action: run main/othervm SubjectAltNameIP [::1]
started: Sun Dec 14 21:22:53.422 CET 2025
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules java.base --add-exports java.base/sun.net.util=ALL-UNNAMED
Process id: 14723
finished: Sun Dec 14 21:22:59.728 CET 2025
elapsed time (seconds): 6.306
----------configuration:(4/101)----------
Boot Layer
  add modules: java.base
  add exports: java.base/sun.net.util ALL-UNNAMED

----------System.out:(0/0)----------
----------System.err:(26/1574)----------
java.lang.RuntimeException: Server failed to start.
at SubjectAltNameIP.doClientSide(SubjectAltNameIP.java:139)
at SubjectAltNameIP.<init>(SubjectAltNameIP.java:189)
at SubjectAltNameIP.main(SubjectAltNameIP.java:176)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.Thread.run(Thread.java:1516)
**Caused by: java.net.SocketException: Protocol family unavailable**
at java.base/sun.nio.ch.Net.bind0(Native Method)
at java.base/sun.nio.ch.Net.bind(Net.java:525)
at java.base/sun.nio.ch.Net.bind(Net.java:514)
at java.base/sun.nio.ch.NioSocketImpl.bind(NioSocketImpl.java:641)
at java.base/java.net.ServerSocket.bind(ServerSocket.java:326)
at java.base/java.net.ServerSocket.<init>(ServerSocket.java:222)
at java.base/javax.net.ssl.SSLServerSocket.<init>(SSLServerSocket.java:155)
at java.base/sun.security.ssl.SSLServerSocketImpl.<init>(SSLServerSocketImpl.java:80)
at java.base/sun.security.ssl.SSLServerSocketFactoryImpl.createServerSocket(SSLServerSocketFactoryImpl.java:87)
at SubjectAltNameIP.doServerSide(SubjectAltNameIP.java:106)
at SubjectAltNameIP.lambda$startServer$0(SubjectAltNameIP.java:203)
... 1 more

@MBaesken
Copy link
Member Author

MBaesken commented Jan 2, 2026

Changes look good.

Thanks for the review !

@AlanBateman
Copy link
Contributor

Hi Alan, it was the test javax/net/ssl/HttpsURLConnection/SubjectAltNameIP.java .
See https://bugs.openjdk.org/browse/JDK-8373676 .

Thanks, just checking that there was an issue to track fixing the test.

Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Matthias, this looks OK to me. Please run tier2 tests before integrating.

@MBaesken
Copy link
Member Author

MBaesken commented Jan 5, 2026

Thanks for the reviews ! I observed no issues in the tier2 tests .

/integrate

@openjdk
Copy link

openjdk bot commented Jan 5, 2026

Going to push as commit 1630382.
Since your change was applied there have been 133 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 5, 2026
@openjdk openjdk bot closed this Jan 5, 2026
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 5, 2026
@openjdk
Copy link

openjdk bot commented Jan 5, 2026

@MBaesken Pushed as commit 1630382.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated net net-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

4 participants