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

David Holmes dholmes at openjdk.java.net
Thu May 27 11:15:19 UTC 2021


On Thu, 27 May 2021 07:15:46 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Correct typos and add a comment for a corner case.
>>   
>>   Without that flush(), TEST='gtest:gtest:LogFileOutput*' can't pass
>>   in async mode.
>
> src/hotspot/share/logging/logConfiguration.cpp line 267:
> 
>> 265:     // User may disable a logOuput like this:
>> 266:     // LogConfiguration::parse_log_arguments(filename, "all=off", "", "", &stream);
>> 267:     // Just be conservative. Flush them all before deleting idx.
> 
> Thanks for the comment. Note that this is still a best-effort attempt because immediately after the flush completes further logging could happen before the idx is deleted. So the async writer thread can still encounter  a fatal error. But as this can only happen with direct internal/gtest use of the LogConfiguration API I don't think this is a concern. Had I understood the issue sooner (my fault) I would have suggested just fixing the test to disallow async mode rather than making a change to the functional code. But this is something we can re-examine later.

Note: my comment about further logging being possible is because I can't obviously tell that something prior to this would have caused it to be disabled. But that may be the case, and then there is no issue with the flush at  all.

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

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


More information about the hotspot-dev mailing list