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

Vladimir Petko vpetko at openjdk.org
Mon Apr 22 08:56:39 UTC 2024


On Mon, 26 Feb 2024 02:47:26 GMT, Vladimir Petko <vpetko at openjdk.org> wrote:

> Hi all,
> 
> This pull request contains a backport of commit [d1099033](https://github.com/openjdk/jdk/commit/d1099033ac63b9dd0dd6e3a7341db929e9e0e56e) from the [openjdk/jdk](https://git.openjdk.org/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] https://github.com/jruby/jruby/issues/8069
> [2] https://bugs.launchpad.net/ubuntu/+source/jruby/+bug/2054943
> [3] https://bugs.launchpad.net/ubuntu/+source/openjdk-21/+bug/2054943

This pull request has now been integrated.

Changeset: 667513ae
Author:    Vladimir Petko <vpetko at openjdk.org>
Committer: Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.org/jdk21u-dev/commit/667513aeb1ffdab3ada8595d55ff955b8d3d77c3
Stats:     84 lines in 2 files changed: 70 ins; 4 del; 10 mod

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

Backport-of: d1099033ac63b9dd0dd6e3a7341db929e9e0e56e

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

PR: https://git.openjdk.org/jdk21u-dev/pull/290


More information about the jdk-updates-dev mailing list