RFR: 8229517: Support for optional asynchronous/buffered logging

Xin Liu xliu at openjdk.java.net
Sun Mar 28 01:15:28 UTC 2021


On Fri, 26 Mar 2021 09:41:01 GMT, Volker Simonis <simonis at openjdk.org> wrote:

>> This patch provides a buffer to store asynchrounous messages and flush them to
>> underlying files periodically.
>
> src/hotspot/share/logging/logFileOutput.cpp line 324:
> 
>> 322:   if (_async_mode && flusher != NULL) {
>> 323:     flusher->enqueue(*this, decorations, msg);
>> 324:     return 0;
> 
> I think the contract of `LogFileOutput::write()` is not clear. Should this return the number of characters that have been actually written out or the number of characters that have been consumed. For the time beeing this doesn't seem to be a problem though, because the current callers of `LogFileOutput::write()` don't seem to check the return value anyway.

yes, it seems that it doesn't matter.  logTagSet.cpp don't read the return value of LogOutput::write(). 
'return 0' may not be good here. IMHO, we can return -1, which means unknown or NA.

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

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


More information about the hotspot-dev mailing list