RFR: 8229517: Support for optional asynchronous/buffered logging [v14]

Xin Liu xliu at openjdk.java.net
Mon May 17 07:12:51 UTC 2021


On Thu, 13 May 2021 06:52:52 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix build on Windows.
>>   
>>   It seems that headers on Windows define WAIT_TIMEOUT somewhere. rename it.
>
> src/hotspot/share/logging/logAsyncFlusher.cpp line 142:
> 
>> 140:     _buffer.pop_all(&logs);
>> 141:     AsyncLogMapIterator iter;
>> 142:     _stats.iterate(&iter);
> 
> All this is really difficult to understand for the casual reader. Clearer naming would help:
> - something like "move-list-content" instead of pop_all
> - the whole point of this iteration thing is to print the dropped counters, right? A function "Print Drop Counters" would be clearer. Unless you go the one-async-buffer-per-logfileoutput-route I mentioned earlier.

I will send out a patch to fix this along with the new discard policy. 
There's another issue.  `_stats.iterate(&iter)` here invokes `output->write_blocking` while holding lock!
This has compromised non-blocking protocol.

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

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


More information about the hotspot-dev mailing list