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

8325028: (ch) Pipe channels should lazily set socket to non-blocking mode on first use by virtual thread #290

Closed

Conversation

vpa1977
Copy link

@vpa1977 vpa1977 commented Feb 26, 2024

Hi all,

This pull request contains a backport of commit d1099033 from the openjdk/jdk repository.

The commit being backported was authored by Alan Bateman on 8 Feb 2024 and was reviewed by Brian Burkhalter.

This change fixes a bug in jruby[1] that broken pipeline functions of Open3[1][2].
This change is high risk as there is no jtreg test directly testing the pipe behaviour.
Patch applies cleanly to 21u.
The patch was tested against JRuby test suite in Ubuntu. Without the patch the following tests[3] fail:

1) Failure:
TestOpen3#test_pipeline_start [/tmp/autopkgtest.Dz4xQk/autopkgtest_tmp/test/mri/test_open3.rb:303]:
Failed assertion, no message given.

  2) Failure:
TestOpen3#test_pipeline_w [/tmp/autopkgtest.Dz4xQk/autopkgtest_tmp/test/mri/test_open3.rb:288]:
<true> expected but was
<false>.

  3) Failure:
TestOpen3#test_capture3_flip [/tmp/autopkgtest.Dz4xQk/autopkgtest_tmp/test/mri/test_open3.rb:190]:

With the patch, they pass. Also the reproducer

require 'open3'

RUBY = 'jruby'
Open3.pipeline_r([RUBY, '-e', 'print "1"'],
                     [RUBY, '-e', 'print STDIN.read + "2"']) {|o,ts|
      print(o.read)
    }
---

outputs 12 as expected in multiple runs.
There is no regression in tier1 and tier2 tests ran on Ubuntu.

Thanks!

[1] jruby/jruby#8069
[2] https://bugs.launchpad.net/ubuntu/+source/jruby/+bug/2054943
[3] https://bugs.launchpad.net/ubuntu/+source/openjdk-21/+bug/2054943


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8325028 needs maintainer approval

Issue

  • JDK-8325028: (ch) Pipe channels should lazily set socket to non-blocking mode on first use by virtual thread (Enhancement - P4 - Approved)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 290

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 26, 2024

👋 Welcome back vpetko! 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 openjdk bot changed the title Backport d1099033ac63b9dd0dd6e3a7341db929e9e0e56e 8325028: (ch) Pipe channels should lazily set socket to non-blocking mode on first use by virtual thread Feb 26, 2024
@openjdk
Copy link

openjdk bot commented Feb 26, 2024

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

@vpa1977 vpa1977 marked this pull request as ready for review February 26, 2024 05:05
@openjdk
Copy link

openjdk bot commented Feb 26, 2024

⚠️ @vpa1977 This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 26, 2024
@mlbridge
Copy link

mlbridge bot commented Feb 26, 2024

Webrevs

@GoeLin
Copy link
Member

GoeLin commented Mar 1, 2024

@vpa1977 please also backport this to jdk22u.

@vpa1977
Copy link
Author

vpa1977 commented Mar 1, 2024

@vpa1977 please also backport this to jdk22u.
I apologise for forgetting this. I have created openjdk/jdk22u#79 .

@GoeLin
Copy link
Member

GoeLin commented Mar 1, 2024

Thanks. I also ran it through our nightly testing. No issues found.

@openjdk openjdk bot removed the approval label Mar 6, 2024
@vpa1977
Copy link
Author

vpa1977 commented Mar 12, 2024

/approval request

@openjdk
Copy link

openjdk bot commented Mar 12, 2024

@vpa1977
8325028: The approval request has been created successfully.

@openjdk openjdk bot added the approval label Mar 12, 2024
@openjdk
Copy link

openjdk bot commented Mar 13, 2024

@vpa1977 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:

8325028: (ch) Pipe channels should lazily set socket to non-blocking mode on first use by virtual thread

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 24 new commits pushed to the master branch:

  • 7c63791: 8319955: Improve dependencies removal during class unloading
  • 2a3c4fc: 8318109: Writing JFR records while a CHT has taken its lock asserts in rank checking
  • 5a94e48: 8317600: VtableStubs::stub_containing() table load not ordered wrt to stores
  • 41c8606: 8316959: Improve InlineCacheBuffer pending queue management
  • f341621: 8323685: PrintSystemDictionaryAtExit has mutex rank assert
  • e63addb: 8315503: G1: Code root scan causes long GC pauses due to imbalanced iteration
  • 686399a: 8318599: HttpURLConnection cache issues leading to crashes in JGSS w/ native GSS introduced by 8303809
  • 6c5500b: 8318986: Improve GenericWaitBarrier performance
  • f0f2e70: 8326936: RISC-V: Shenandoah GC crashes due to incorrect atomic memory operations
  • 7743b6c: Merge
  • ... and 14 more: https://git.openjdk.org/jdk21u-dev/compare/18254641606816215189a06a281e1763fd86eecf...master

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot removed the approval label Mar 19, 2024
@GoeLin
Copy link
Member

GoeLin commented Mar 19, 2024

Hi @vpa1977
please have a look at https://wiki.openjdk.org/display/JDKUpdates/How+to+contribute+or+backport+a+fix to write a proper fix request comment. Removed the tag for now.

@vpa1977
Copy link
Author

vpa1977 commented Mar 19, 2024

Hi @vpa1977 please have a look at https://wiki.openjdk.org/display/JDKUpdates/How+to+contribute+or+backport+a+fix to write a proper fix request comment. Removed the tag for now.

Thank you!!!
I have added the comment, but did not set the tag. Please advice if i should add more details before tagging the issue?

@openjdk openjdk bot added approval ready Pull request is ready to be integrated and removed approval labels Apr 9, 2024
@vpa1977
Copy link
Author

vpa1977 commented Apr 10, 2024

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 10, 2024
@openjdk
Copy link

openjdk bot commented Apr 10, 2024

@vpa1977
Your change (at version 6ac72c2) is now ready to be sponsored by a Committer.

@shipilev
Copy link
Member

Hey @vpa1977, the last GHA test run was back in Feburary. Please merge from master and see that GHAs are still green? After that, I can sponsor.

@openjdk openjdk bot removed the sponsor Pull request is ready to be sponsored label Apr 20, 2024
@vpa1977
Copy link
Author

vpa1977 commented Apr 20, 2024

@shipilev Thank you!!! I've merged master and the tests passed.

@vpa1977
Copy link
Author

vpa1977 commented Apr 20, 2024

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 20, 2024

@vpa1977 Only Committers are allowed to sponsor changes.

@vpa1977
Copy link
Author

vpa1977 commented Apr 21, 2024

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 21, 2024
@openjdk
Copy link

openjdk bot commented Apr 21, 2024

@vpa1977
Your change (at version 086bc62) is now ready to be sponsored by a Committer.

@shipilev
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 22, 2024

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

  • 515783b: 8328166: Epsilon: 'EpsilonHeap::allocate_work' misuses the parameter 'size' as size in bytes
  • 7c63791: 8319955: Improve dependencies removal during class unloading
  • 2a3c4fc: 8318109: Writing JFR records while a CHT has taken its lock asserts in rank checking
  • 5a94e48: 8317600: VtableStubs::stub_containing() table load not ordered wrt to stores
  • 41c8606: 8316959: Improve InlineCacheBuffer pending queue management
  • f341621: 8323685: PrintSystemDictionaryAtExit has mutex rank assert
  • e63addb: 8315503: G1: Code root scan causes long GC pauses due to imbalanced iteration
  • 686399a: 8318599: HttpURLConnection cache issues leading to crashes in JGSS w/ native GSS introduced by 8303809
  • 6c5500b: 8318986: Improve GenericWaitBarrier performance
  • f0f2e70: 8326936: RISC-V: Shenandoah GC crashes due to incorrect atomic memory operations
  • ... and 15 more: https://git.openjdk.org/jdk21u-dev/compare/18254641606816215189a06a281e1763fd86eecf...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 22, 2024
@openjdk openjdk bot closed this Apr 22, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Apr 22, 2024
@openjdk
Copy link

openjdk bot commented Apr 22, 2024

@shipilev @vpa1977 Pushed as commit 667513a.

💡 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
backport clean integrated Pull request has been integrated
3 participants