RFR: 8355608: Async UL should take the file lock of stream when outputting
Johan Sjölen
jsjolen at openjdk.org
Fri Apr 25 13:13:20 UTC 2025
With the introduction of [JDK-8349755](https://bugs.openjdk.org/browse/JDK-8349755), it is not entirely clear any longer that the Async UL has exclusive access to the files which are being logged to in the JVM. We should take the file lock for the stream being logged to for safety's sake.
If, for example, an unattached thread logs, then it will do so without the help of the Async UL thread.
This is expected to very rarely, if ever, happen. Since taking an uncontested mutex is very cheap, I expect this to have a negligible performance impact.
Testing: GHA, tier1
Cheers,
Johan
-------------
Commit messages:
- Take the file locker
Changes: https://git.openjdk.org/jdk/pull/24874/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24874&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8355608
Stats: 5 lines in 1 file changed: 1 ins; 3 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/24874.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24874/head:pull/24874
PR: https://git.openjdk.org/jdk/pull/24874
More information about the hotspot-runtime-dev
mailing list