RFR: 8344583: Make ArchiveWorkers lifecycle robust
Aleksey Shipilev
shade at openjdk.org
Wed Nov 20 13:03:50 UTC 2024
It is obvious from the bug report that `ArchiveWorkers` lifecycle is not robust enough. Looks like archive workers escape their normal shutdown sequence when an unusual VM exit path is taken. We have tried to capture this in before_exit, but that is obviously not enough.
This PR reworks the lifecycle a bit: we now use the scoped object to manage `ArchiveWorkers` state. Previous version was carrying `ArchiveWorkers` for the entire lifecycle of CDS, but that runs into problems when VM exits in the middle of it. This PR shortens the lifecycle of `ArchiveWorkers` to the only place where they are used. To avoid the loss of usefulness, we now allow multiple pool restarts, so if any other code would need these workers, they can restart the pool again. New gtest checks this works.
Additional testing:
- [x] macos-aarch64-server-fastdebug: reported failing tests are not failing anymore
- [ ] macos-aarch64-server-fastdebug, `tier{1,2,3}`
- [ ] linux-x86_64-server-fastdebug, `all`
-------------
Commit messages:
- Newline
- Basic fix
Changes: https://git.openjdk.org/jdk/pull/22276/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22276&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8344583
Stats: 138 lines in 6 files changed: 109 ins; 22 del; 7 mod
Patch: https://git.openjdk.org/jdk/pull/22276.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/22276/head:pull/22276
PR: https://git.openjdk.org/jdk/pull/22276
More information about the hotspot-runtime-dev
mailing list