RFR: 8376290: SocketChannel.finishConnect() contains confusing "getsockopt" in exception message for a failed connect() on Windows [v6]

Jaikiran Pai jpai at openjdk.org
Tue Jan 27 15:55:11 UTC 2026


> Can I please get a review of this change which proposes to remove the confusing "getsockopt" text from the exception reported on Windows when `SocketChannel.finishConnect()` raises an exception due to a failed `connect()`? 
> 
> This addresses https://bugs.openjdk.org/browse/JDK-8376290 and as noted in that issue, this looks like an oversight when changes were done for https://bugs.openjdk.org/browse/JDK-8317603. Prior to that, on older versions the exception reported on Windows was:
> 
> 
> java.net.ConnectException: Connection refused: no further information
> 
> 
> With the current proposed changes in this PR, the exception will now be `java.net.ConnectException: Connection refused` which matches what we report on *nix platforms.
> 
> A new jtreg test has been added to reproduce the original text and verify the change. tier1, tier2 and tier3 continue to pass with this change.

Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:

  update code comment in test

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/29409/files
  - new: https://git.openjdk.org/jdk/pull/29409/files/b57b088e..2ad911f9

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=29409&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=29409&range=04-05

  Stats: 9 lines in 1 file changed: 3 ins; 2 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/29409.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29409/head:pull/29409

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


More information about the net-dev mailing list