jdk
jdk copied to clipboard
8331987: Enhance stacktrace clarity for CompletableFuture CancellationException
This change adds wrapping of the CancellationException produced by CompletableFuture::get() and CompletableFuture::join() to add more diagnostic information and align better with FutureTask.
Running the sample code from the JBS issue in JShell will produce the following:
jshell> java.util.concurrent.CancellationException:
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:392)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
at REPL.$JShell$18.m2($JShell$18.java:10)
at REPL.$JShell$17.m1($JShell$17.java:8)
at REPL.$JShell$16B.lambda$main$0($JShell$16B.java:8)
at java.base/java.lang.Thread.run(Thread.java:1575)
Caused by: java.util.concurrent.CancellationException
at java.base/java.util.concurrent.CompletableFuture.cancel(CompletableFuture.java:2510)
at REPL.$JShell$16B.lambda$main$1($JShell$16B.java:11)
... 1 more
Progress
- [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
Issue
- JDK-8331987: Enhance stacktrace clarity for CompletableFuture CancellationException (Enhancement - P4)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19219/head:pull/19219
$ git checkout pull/19219
Update a local copy of the PR:
$ git checkout pull/19219
$ git pull https://git.openjdk.org/jdk.git pull/19219/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19219
View PR using the GUI difftool:
$ git pr show -t 19219
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19219.diff
Webrev
:wave: Welcome back vklang! 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.
@viktorklang-ora 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:
8331987: Enhance stacktrace clarity for CompletableFuture CancellationException
Reviewed-by: alanb, dfuchs
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 26 new commits pushed to the master
branch:
- 957eb611ce2531a3fcc764813ad1e0776887fdda: 8331429: [JVMCI] Cleanup JVMCIRuntime allocation routines
- 2f10a316ff0c5a4c124b94f6fabb38fb119d2c82: 8302850: Implement C1 clone intrinsic that reuses arraycopy code for primitive arrays
- c642f44bbe1e4cdbc23496a34ddaae30990ce7c0: 8329839: Cleanup ZPhysicalMemoryBacking trace logging
- d04ac14bdbab4187d0be98b8471f90be8a14f649: 8332236: javac crashes with module imports and implicitly declared class
- 4e77cf881d031e5b0320915b3eabd7702e560291: 8330795: C2: assert((uint)type <= T_CONFLICT && _zero_type[type] != nullptr) failed: bad type with -XX:-UseCompressedClassPointers
- 7b4ba7f90ab9ea5e1070c79534c587dad17d1bdd: 8325932: Replace ATTRIBUTE_NORETURN with direct [[noreturn]]
- 0bb5ae645165b97527ecccf02308df6072c363d8: 8332248: (fc) java/nio/channels/FileChannel/BlockDeviceSize.java failed with RuntimeException
- 4d32c607a4b496bf2bb09e54167ecbbab5569a0c: 8322008: Exclude some CDS tests from running with -Xshare:off
- e91492ab4333c61f39b50eb428fa932131a5b908: 8313674: (fc) java/nio/channels/FileChannel/BlockDeviceSize.java should test for more block devices
- 95a601316de06b4b0fbf6e3c7777be5d2a1ca978: 8332042: Move MEMFLAGS to its own include file
- ... and 16 more: https://git.openjdk.org/jdk/compare/5053b70a7fc67ce9b73dbeecbdd88fbc34d45e04...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.
@DougLea @AlanBateman Submitting this for review as we discussed.
@viktorklang-ora 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.
/integrate
Going to push as commit 8a4315f833f3700075d65fae6bc566011c837c07.
Since your change was applied there have been 36 commits pushed to the master
branch:
- 491b3b45634fffb0101244f7d491a1681e7e8002: 8332256: Shenandoah: Do not visit heap threads during shutdown
- 9c02c8dd71023df6338cb94997bca6b00768af6f: 8332255: Shenandoah: Remove duplicate definition of init mark closure
- 42ccb74399113a3d59ce016483518f033dd6e010: 8331940: ClassFile API ArrayIndexOutOfBoundsException with certain class files
- 61aff6db15d5bdda77427af5ce34d0fe43373197: 8332112: Update nsk.share.Log to don't print summary during VM shutdown hook
- 30bb066b1982c5318d54bfe74115306c602e2974: 8332003: Clarify javadoc for MemoryLayout::offsetHandle
- c4867c62c44b48e48845608fe4b29b58749767ad: 8329273: C2 SuperWord: Some basic MemorySegment IR tests
- 8032d640c0d34fe507392a1d4faa4ff2005c771d: 8332245: C2: missing record_for_ign() call in GraphKit::must_be_not_null()
- fa043aec425ae1e3086d09492b3fabcfbd3fa779: 8294880: Review running time of jdk/internal/shellsupport/doc/JavadocHelperTest.java
- a5005c87c4d5598eb54e9824105767d833f9660b: 8330814: Cleanups for KeepAliveCache tests
- 1a944478a26a766f5a573a1236b642d8e7b0685c: 8332111: [BACKOUT] A way to align already compiled methods with compiler directives
- ... and 26 more: https://git.openjdk.org/jdk/compare/5053b70a7fc67ce9b73dbeecbdd88fbc34d45e04...master
Your commit was automatically rebased without conflicts.
@viktorklang-ora Pushed as commit 8a4315f833f3700075d65fae6bc566011c837c07.
:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.