[jdk17] RFR: 8267952: async logging supports to dynamically change tags and decorators
Xin Liu
xliu at openjdk.java.net
Thu Jun 24 01:18:28 UTC 2021
On Thu, 24 Jun 2021 00:06:13 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> This patch fixed intermittent crashes of gtest/AsyncLogGtest.java. The root cause
>> is that previous flush() can't guarantee flush all pending messages in AsyncLog
>> buffer. This patch implements flush() using a synchronizaton token and waits for
>> completion. This approach isn't MT-safe but it can serialize all flush() calls in
>> a thread.
>>
>> Two concurrent tests are appended to cover the hazard cases.
>> This patch also comments LogConfiguration::configure_output() MT-safety.
>
> src/hotspot/share/logging/logAsyncWriter.cpp line 196:
>
>> 194: AsyncLogMessage token(nullptr, d, nullptr);
>> 195:
>> 196: // not disposable
>
> I don't know what "not disposable" means.
The reason I don't call enqueue_locked() here because it may be dropped due to buffer size.
This is a control token. if it gets dropped, flush() will get stuck forever.
not droppable?
-------------
PR: https://git.openjdk.java.net/jdk17/pull/130
More information about the hotspot-runtime-dev
mailing list