RFR: 8344583: Make ArchiveWorkers lifecycle robust [v2]

Aleksey Shipilev shade at openjdk.org
Thu Nov 21 07:40:36 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 archive load path, 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
>  - [x] macos-aarch64-server-fastdebug, `tier{1,2}`
>  - [x] linux-x86_64-server-fastdebug, `all`

Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:

  Move the use of worker pool directly where we need it

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/22276/files
  - new: https://git.openjdk.org/jdk/pull/22276/files/b53792ff..9f0dd01c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22276&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22276&range=00-01

  Stats: 3 lines in 2 files changed: 1 ins; 2 del; 0 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