RFR: 8267926: AsyncLogGtest.java fails on assert with: decorator was not part of the decorator set specified at creation. [v3]
Xin Liu
xliu at openjdk.java.net
Tue Jun 1 04:09:10 UTC 2021
On Mon, 31 May 2021 22:22:29 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Increase reader's counter before creating LogDecoration.
>
> src/hotspot/share/logging/logConfiguration.cpp line 279:
>
>> 277: //
>> 278: AsyncLogWriter::flush();
>> 279:
>
> As soon as this completes, new logging requests could have been enqueued, thus restoring the hazard.
This is not true. Yes, new logsites could have been enqueued, but they must see the new tags and the new decorations. please note `ts->set_output_level(output, level)` implies a wait_until_no_readers() if anything does change.
One trick is I treat asynclog enqueuing as same as synclog writing. `wait_until_no_readers` also takes effect for async logging. It guarantees that all enqueuing async logs are done before the reader counter reset back to 0. If there're ongoing log requests with old tags or decorations, they all have enqueued before `wait_until_no_readers()` returns. that's why one flush() is enough for the two hazards.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4257
More information about the hotspot-runtime-dev
mailing list