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

David Beaumont duke at openjdk.org
Fri Feb 21 12:30:57 UTC 2025


On Fri, 21 Feb 2025 10:41:25 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> David Beaumont has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updating code and tests according to feedback and discussions.
>
> src/java.logging/share/classes/java/util/logging/FileHandler.java line 747:
> 
>> 745: 
>> 746:     @Override
>> 747:     void synchronousPostWriteHook() {
> 
> I would add:
> 
> assert Thread.holdsLock(this);
> 
> here

I decided against doing that because it's tested for in the unit test, and it adds "work" for every `publish()` method of every `StreamHandler` subclass run with assertions enabled, which feels unwanted to me.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23491#discussion_r1965400125


More information about the core-libs-dev mailing list