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

8290036: Define and specify Runtime shutdown sequence #9437

Conversation

stuart-marks
Copy link
Member

@stuart-marks stuart-marks commented Jul 8, 2022

The concept of the shutdown sequence needs to be specified more clearly. This PR adds text for this into the class specification of java.lang.Runtime. Also includes adjustments to related areas in addShutdownHook, halt, and in the System and Thread classes. The changes here should coordinate with similar changes to JLS 12.8, JVMS 5.7, and the Invocation API chapter of the JNI Specification.


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
  • Change requires a CSR request to be approved

Issues

  • JDK-8290036: Define and specify Runtime shutdown sequence
  • JDK-8294817: Define and specify Runtime shutdown sequence (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9437

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 8, 2022

👋 Welcome back smarks! 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 Jul 8, 2022

@stuart-marks The following label will be automatically applied to this pull request:

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Jul 8, 2022
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Hi Stuart,

There's nothing I would consider harmful in these changes, but I also don't see them as necessary.

Cheers.

src/java.base/share/classes/java/lang/Runtime.java Outdated Show resolved Hide resolved
@stuart-marks
Copy link
Member Author

Sorry David I should have clarified this a bit. The changes currently in this draft PR are merely what occurred to Alex and me while we were working on JLS 12.8. There are a bunch of other issues that need to be covered or at clarified clarified here, or possibly in the Runtime class specification. I'll add them to the bug report, and eventually we'll update this PR with further changes.

@stuart-marks
Copy link
Member Author

Discussion of the changes in this PR are taking place in the bug report:

https://bugs.openjdk.org/browse/JDK-8290036

@stuart-marks stuart-marks marked this pull request as ready for review August 3, 2022 00:47
@stuart-marks
Copy link
Member Author

/csr

@openjdk openjdk bot added rfr Pull request is ready for review csr Pull request needs approved CSR before integration labels Aug 3, 2022
@openjdk
Copy link

openjdk bot commented Aug 3, 2022

@stuart-marks has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@stuart-marks please create a CSR request for issue JDK-8290036 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@mlbridge
Copy link

mlbridge bot commented Aug 3, 2022

src/java.base/share/classes/java/lang/Runtime.java Outdated Show resolved Hide resolved
src/java.base/share/classes/java/lang/Runtime.java Outdated Show resolved Hide resolved
src/java.base/share/classes/java/lang/Runtime.java Outdated Show resolved Hide resolved
src/java.base/share/classes/java/lang/Runtime.java Outdated Show resolved Hide resolved
src/java.base/share/classes/java/lang/Runtime.java Outdated Show resolved Hide resolved
- specify that starting a shutdown hook explicitly has an unspecified
  effect on the shutdown sequence
- link Thread class doc to shutdown sequence
- link to Thread.UncaughtExceptionHandler
- clarify that only live non-daemon threads are significant
- use "thread termination" to conform to the text in the Thread class
- adjust line breaks and whitespace
@stuart-marks stuart-marks changed the title 8290036: adjustments to specification of Runtime::addShutdownHook 8290036: Define and specify Runtime shutdown sequence Aug 4, 2022
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Hi Stuart,

Looking good overall. A few minor comments and one more substantive one regarding DestroyJavaVM.

Thanks,
David

src/java.base/share/classes/java/lang/Runtime.java Outdated Show resolved Hide resolved
src/java.base/share/classes/java/lang/Runtime.java Outdated Show resolved Hide resolved
src/java.base/share/classes/java/lang/Thread.java Outdated Show resolved Hide resolved
src/java.base/share/classes/java/lang/Thread.java Outdated Show resolved Hide resolved
src/java.base/share/classes/java/lang/Thread.java Outdated Show resolved Hide resolved
@stuart-marks
Copy link
Member Author

OK, I finally got back to this. I incorporated most suggested edits. Please re-review.

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

The updates in ca36905 look okay to me, I don't have any more comments/issues.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Looks good! Noting further from me. Thanks @stuart-marks !

@stuart-marks
Copy link
Member Author

CSR drafted, please review:

https://bugs.openjdk.org/browse/JDK-8294817

@stuart-marks
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 5, 2022

@stuart-marks This pull request has not yet been marked as ready for integration.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Oct 5, 2022
@openjdk
Copy link

openjdk bot commented Oct 5, 2022

@stuart-marks 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:

8290036: Define and specify Runtime shutdown sequence

Reviewed-by: dholmes, alanb

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

  • 0ec1838: 8294869: Correct failure of RemovedJDKInternals.java after JDK-8294618
  • 87acfee: 8294397: Replace StringBuffer with StringBuilder within java.text
  • f2c5718: 8294734: Redundant override in AES implementation
  • 536c9a5: 8294618: Update openjdk.java.net => openjdk.org
  • f531dae: 8294840: langtools OptionalDependencyTest.java use File.pathSeparator
  • ee6c391: 8289925: Shared code shouldn't reference the platform specific method frame::interpreter_frame_last_sp()
  • bd90c4c: 8282900: runtime/stringtable/StringTableCleaningTest.java verify unavailable at this moment
  • 979efd4: 8289004: investigate if SharedRuntime::get_java_tid parameter should be a JavaThread*
  • b9eeec2: 8294310: compare.sh fails on macos after JDK-8293550
  • 13a5000: 8294151: JFR: Unclear exception message when dumping stopped in memory recording
  • ... and 7 more: https://git.openjdk.org/jdk/compare/1dafbe3f944fdb3027df38a886fd15abc3b476a7...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.

➡️ 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 Oct 5, 2022
@stuart-marks
Copy link
Member Author

I guess I got into a race with the bot and lost. Retrying.

/integrate

@openjdk
Copy link

openjdk bot commented Oct 5, 2022

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

  • 0ec1838: 8294869: Correct failure of RemovedJDKInternals.java after JDK-8294618
  • 87acfee: 8294397: Replace StringBuffer with StringBuilder within java.text
  • f2c5718: 8294734: Redundant override in AES implementation
  • 536c9a5: 8294618: Update openjdk.java.net => openjdk.org
  • f531dae: 8294840: langtools OptionalDependencyTest.java use File.pathSeparator
  • ee6c391: 8289925: Shared code shouldn't reference the platform specific method frame::interpreter_frame_last_sp()
  • bd90c4c: 8282900: runtime/stringtable/StringTableCleaningTest.java verify unavailable at this moment
  • 979efd4: 8289004: investigate if SharedRuntime::get_java_tid parameter should be a JavaThread*
  • b9eeec2: 8294310: compare.sh fails on macos after JDK-8293550
  • 13a5000: 8294151: JFR: Unclear exception message when dumping stopped in memory recording
  • ... and 7 more: https://git.openjdk.org/jdk/compare/1dafbe3f944fdb3027df38a886fd15abc3b476a7...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 5, 2022

@stuart-marks Pushed as commit d4142d8.

💡 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
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
4 participants