RFR: 8267952: async logging supports to dynamically change tags and decorators [v6]

Xin Liu xliu at openjdk.java.net
Wed Jun 23 08:48:37 UTC 2021


On Tue, 22 Jun 2021 16:50:16 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> Support dynamic reconfiguration for async logging. 2 unittests are provided.
>> The regression test discovers a race condition in LogTagSet::log() even with
>> synchronous logging. It's not MT-safe if context switch happens between the
>> creation of LogDecorations  and LogOutputList::Iterator. fixed.
>
> Xin Liu has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision:
> 
>  - AsyncLogWrite::flush() uses a synchronization token and wait for completion.
>    
>    This patch serializes all flush() calls in one thread.
>  - Merge branch 'master' into JDK-8267952
>  - Revert "Use Atomic::load/store for decorators."
>    
>    This reverts commit f279f2639bc638a35ae6c716987feb22d36a2a07.
>  - Revert "Fix VC++ warning C4099"
>    
>    This reverts commit 157a065876850df784d9e7c034e106f4532b607a.
>  - Fix VC++ warning C4099
>  - Use Atomic::load/store for decorators.
>    
>    This patch also installed a sanity check which will assert that
>    LogOutput::_decorators is subset of LogDecocrations. It will disclose
>    more information if the assertion fails.
>  - Merge branch 'master' into JDK-8267952
>  - Add comments in LogTagSet::log().
>  - 8267952: async logging supports to dynamically change tags and decorators

I understand your fix. You mark write() with keyword "synchonized in java" . One bonus is flush() is MT-safe as well.

Yes, the benefit of token is that only one thread calls write().  It doesn't pay "synchronized" method cost if no flush() is invoked. I will pick one solution and remake the PR. thanks!

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

PR: https://git.openjdk.java.net/jdk/pull/4408


More information about the hotspot-runtime-dev mailing list