RFR: 8349206: j.u.l.Handler classes create deadlock risk via synchronized publish() method

David Beaumont duke at openjdk.org
Wed Feb 12 15:25:52 UTC 2025


8349206: j.u.l.Handler classes create deadlock risk via synchronized publish() method.

1. Remove synchronization of calls to publish() in Handlers in java.util.logging package.
2. Add explanatory comments to various affected methods.
3. Add a test to ensure deadlocks no longer occur.

Note that this change does not address issue in MemoryHandler (see JDK-8349208).

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

Commit messages:
 - Tweaking the comment in Handler.
 - Reverted comments in Formatter and re-worked the comment in Handler to be more direct.
 - Merge remote-tracking branch 'origin/JDK-8349206-1' into JDK-8349206-1
 - Making sure handlers are closed in tests and adding FileHandler test.
 - Making sure handlers are closed in tests and adding FileHandler test.
 - Re-adjust the comment about parent locking.
 - Adjust copyright back to just start + current years.
 - 8349206: j.u.l.Handler classes create deadlock risk via synchronized publish() method.

Changes: https://git.openjdk.org/jdk/pull/23491/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23491&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8349206
  Stats: 238 lines in 5 files changed: 222 ins; 1 del; 15 mod
  Patch: https://git.openjdk.org/jdk/pull/23491.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23491/head:pull/23491

PR: https://git.openjdk.org/jdk/pull/23491


More information about the core-libs-dev mailing list