RFR: 8299827: Add resolved IP address in connection exception for sockets [v4]

Jaikiran Pai jpai at openjdk.org
Wed Jan 18 06:53:20 UTC 2023


On Tue, 17 Jan 2023 09:22:36 GMT, Ralf Schmelter <rschmelter at openjdk.org> wrote:

>> This change adds the resolved IP address to the exception text of a failed socket connection. This helps if the connection failed because of stale DNS entries.
>
> Ralf Schmelter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Accidentally changed Unix domain socket exception text instead of socket exception text

test/jdk/java/net/Socket/ExceptionText.java line 114:

> 112:                     return; // has no detail msg
> 113:                 System.err.println("msg = " + msg);
> 114:                 throw new RuntimeException("Test failed: exception does not contain address info: " + msg);

It might help debugging any unexpected failures, if the exception message here could include the expected address. Something like:

throw new RuntimeException("Test failed: exception message " + msg + " does not contain address " + dest);

-------------

PR: https://git.openjdk.org/jdk/pull/11961


More information about the net-dev mailing list