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 #17648

Closed
wants to merge 3 commits into from

Conversation

AlanBateman
Copy link
Contributor

@AlanBateman AlanBateman commented Jan 31, 2024

The Unix implementation of the Pipe source/sink channels eagerly configures the underlying socket to be non-blocking in case the pipe is used by a virtual thread. It can be done lazily, as done with the network channels. No changes to the semantics of the APIs, and well tested by the existing tests.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

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

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17648/head:pull/17648
$ git checkout pull/17648

Update a local copy of the PR:
$ git checkout pull/17648
$ git pull https://git.openjdk.org/jdk.git pull/17648/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17648

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17648.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 31, 2024

👋 Welcome back alanb! 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
Copy link

openjdk bot commented Jan 31, 2024

@AlanBateman The following label will be automatically applied to this pull request:

  • nio

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the nio nio-dev@openjdk.org label Jan 31, 2024
@AlanBateman AlanBateman marked this pull request as ready for review February 7, 2024 11:41
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 7, 2024
@mlbridge
Copy link

mlbridge bot commented Feb 7, 2024

Webrevs

Copy link
Member

@bplb bplb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay.

@openjdk
Copy link

openjdk bot commented Feb 7, 2024

@AlanBateman 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

Reviewed-by: bpb

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

  • 3a1f4d0: 8325268: Add policy statement to langtools makefiles concerning warnings
  • 18e24d0: 8325109: Sort method modifiers in canonical order
  • a3a2b1f: 8324881: ObjectSynchronizer::inflate(Thread* current...) is invoked for non-current thread
  • a9c6e87: 8325416: Parallel: Refactor CheckForUnmarkedOops
  • 1ecf74c: 8325306: Rename static huge pages to explicit huge pages
  • c3a632d: 8325248: Serial: Remove Generation::space_iterate
  • 77ee7f0: 8325221: Obsolete TLABStats

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 7, 2024
@jaikiran
Copy link
Member

jaikiran commented Feb 8, 2024

Hello Alan, is the use of the word "socket" in the comments and the method names (and the PR title) intentional? As far as I can see the sink/source channels' underlying resources are file descriptors created out of a pipe() call. Do we use the term "socket" for such cases too?

@AlanBateman
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Feb 8, 2024

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

  • 1fb9e3d: 8325304: Several classes in java.util.jar and java.util.zip don't specify the behaviour for null arguments
  • 9cccf05: 8325367: Rename nsk_list.h
  • be7cc1c: 8323681: SA PointerFinder code should support G1
  • fbd15b2: 8325189: Enable this-escape javac warning in java.base
  • 299a8ee: 8325302: Files.move(REPLACE_EXISTING) throws NoSuchFileException on deleted target
  • 3a1f4d0: 8325268: Add policy statement to langtools makefiles concerning warnings
  • 18e24d0: 8325109: Sort method modifiers in canonical order
  • a3a2b1f: 8324881: ObjectSynchronizer::inflate(Thread* current...) is invoked for non-current thread
  • a9c6e87: 8325416: Parallel: Refactor CheckForUnmarkedOops
  • 1ecf74c: 8325306: Rename static huge pages to explicit huge pages
  • ... and 2 more: https://git.openjdk.org/jdk/compare/4abb10eb0b8ec5aab2e276f5c3a99ff5db7bc877...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 8, 2024

@AlanBateman Pushed as commit d109903.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@AlanBateman
Copy link
Contributor Author

AlanBateman commented Feb 8, 2024

Hello Alan, is the use of the word "socket" in the comments and the method names (and the PR title) intentional?

These channels can work with pipes or an unnamed pair of connected sockets. In the Windows implementation they use a Unix domain socket or a TCP socket, depending on which Windows release. So I kept the comment using "socket" but you are right that it might be a bit clearer to say pipe in the Unix implementation. We can adjust this comment when next touching this area (as the changes here are already integrated).

@jaikiran
Copy link
Member

jaikiran commented Feb 8, 2024

We can adjust this comment when next touching this area (as the changes here are already integrated).

That is fine with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated nio nio-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants