jdk17u-dev icon indicating copy to clipboard operation
jdk17u-dev copied to clipboard

8358764: (sc) SocketChannel.close when thread blocked in read causes connection to be reset (win)

Open antonvoznia opened this issue 2 months ago • 12 comments
trafficstars

Hello,

This is an unclean backport of JDK-8358764 for JDK 17. I used the following JDK 21 backport as the baseline https://github.com/openjdk/jdk21u-dev/pull/2137

Changes:

  • Brought over the Windows socket shutdown on write changes introduced with the virtual threads commit.
  • Removed comments related to virtual threads.
  • Adapted PeerReadsAfterAsyncClose.java to JDK 17 (removed virtual thread test case/scenario).

Notes: The fix affects Windows only. Tested test/jdk/java/nio/ and test/jdk/java/net/ on macOS/ARM and Windows/x64. The introduced test passed successfully.

OpenJDK GHA Sanity Checks also passed.


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue
  • [ ] JDK-8358764 needs maintainer approval

Issue

  • JDK-8358764: (sc) SocketChannel.close when thread blocked in read causes connection to be reset (win) (Bug - P3 - Requested)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/3936/head:pull/3936
$ git checkout pull/3936

Update a local copy of the PR:
$ git checkout pull/3936
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/3936/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3936

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/3936.diff

Using Webrev

Link to Webrev Comment

antonvoznia avatar Sep 16 '25 08:09 antonvoznia

Hi @antonvoznia, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user antonvoznia" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

bridgekeeper[bot] avatar Sep 16 '25 08:09 bridgekeeper[bot]

❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.

openjdk[bot] avatar Sep 16 '25 08:09 openjdk[bot]

/covered Azul Systems

antonvoznia avatar Sep 16 '25 08:09 antonvoznia

/covered

antonvoznia avatar Sep 16 '25 08:09 antonvoznia

Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

bridgekeeper[bot] avatar Sep 16 '25 08:09 bridgekeeper[bot]

@antonvoznia Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

openjdk[bot] avatar Sep 22 '25 08:09 openjdk[bot]

This backport pull request has now been updated with issue from the original commit.

openjdk[bot] avatar Sep 22 '25 08:09 openjdk[bot]

@antonvoznia This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Oct 20 '25 09:10 bridgekeeper[bot]

/keepalive

antonvoznia avatar Oct 20 '25 09:10 antonvoznia

@antonvoznia The pull request is being re-evaluated and the inactivity timeout has been reset.

openjdk[bot] avatar Oct 20 '25 09:10 openjdk[bot]

Webrevs

mlbridge[bot] avatar Oct 27 '25 20:10 mlbridge[bot]

Hi @antonvoznia have you seen my PR? I see yours has been pending for a while, I was not aware of that. Maybe you want to have a look at my PR? Best, Goetz.

GoeLin avatar Oct 28 '25 10:10 GoeLin

The issue was solved by https://github.com/openjdk/jdk17u-dev/pull/4076

antonvoznia avatar Nov 13 '25 11:11 antonvoznia