Skip to content

8322829: Refactor nioBlocker to avoid blocking while holding Thread's interrupt lock#17219

Closed
AlanBateman wants to merge 4 commits intoopenjdk:masterfrom
AlanBateman:JDK-8322829
Closed

8322829: Refactor nioBlocker to avoid blocking while holding Thread's interrupt lock#17219
AlanBateman wants to merge 4 commits intoopenjdk:masterfrom
AlanBateman:JDK-8322829

Conversation

@AlanBateman
Copy link
Contributor

@AlanBateman AlanBateman commented Jan 2, 2024

In preparation for when virtual threads can unmount while holding a monitor or unmount when blocking on monitorenter, the implementation of VirtualThread's interrupt method is refactored to avoid parking/blocking while holding the Thread's interrupt lock. The implementations of sun.nio.ch.Interruptible are refactored to close/wakeup the InterruptibleChannel/Selector after releasing the interrupt lock. There is a lot of test coverage for async close and interrupt, no additional tests are added.


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-8322829: Refactor nioBlocker to avoid blocking while holding Thread's interrupt lock (Enhancement - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17219

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 2, 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 2, 2024

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

  • core-libs
  • nio

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

@openjdk openjdk bot added nio nio-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Jan 2, 2024
@AlanBateman AlanBateman marked this pull request as ready for review January 2, 2024 15:19
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 2, 2024
@mlbridge
Copy link

mlbridge bot commented Jan 2, 2024

Webrevs

Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

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

These changes look OK to me.

There are some trivial javadoc comments which you can decide if are worth doing - it's fine by me either way since like you note it is a tightly controlled internal interface.

@openjdk
Copy link

openjdk bot commented Jan 5, 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:

8322829: Refactor nioBlocker to avoid blocking while holding Thread's interrupt lock

Reviewed-by: jpai

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

  • a40d397: 8323110: Eliminate -Wparentheses warnings in ppc code
  • 7edd10e: 8321786: SegmentAllocator:allocateFrom(ValueLayout, MemorySegment,ValueLayout,long,long) spec mismatch in exception scenario
  • d75d876: 8322806: Eliminate -Wparentheses warnings in aarch64 code
  • e442769: 8322754: click JComboBox when dialog about to close causes IllegalComponentStateException
  • 3560e68: 8322815: Eliminate -Wparentheses warnings in shenandoah code

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 Jan 5, 2024
Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

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

Thank you Alan for the updated javadoc. This looks good to me.

@AlanBateman
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 9, 2024

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

  • 07fce8e: 8320864: Serial: Extract out Full GC related fields from ContiguousSpace
  • 176606d: 8310995: missing @SInCE tags in 36 jdk.dynalink classes
  • 8ae309e: 8318971: Better Error Handling for Jar Tool When Processing Non-existent Files
  • 841ab48: 8322657: CDS filemap fastdebug assert while loading Graal CE Polyglot in isolated classloader
  • 61ebe3b: 8323032: OptimizedModuleHandlingTest failed in dynamic CDS archive mode
  • ca9635d: 8322759: Eliminate -Wparentheses warnings in compiler code
  • 8a4dc79: 8274300: Address dsymutil warning by excluding platform specific files
  • d78e8da: 8322545: Declare newInsets as static in ThemeReader.cpp
  • 24823ba: 8323095: Expand TraceOptoParse block output abbreviations
  • d47393b: 8320128: Clean up Parse constructor for OSR
  • ... and 18 more: https://git.openjdk.org/jdk/compare/faa9c6909dda635eb008b9dada6e06fca47c17d6...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 9, 2024

@AlanBateman Pushed as commit 7286f52.

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

@sspitsyn
Copy link
Contributor

sspitsyn commented Jan 9, 2024

I see this has been already integrated.
Just wanted to confirm that new JVMTI notifications look okay to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated nio nio-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

3 participants