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

David Holmes dholmes at openjdk.java.net
Thu May 27 07:19:23 UTC 2021


On Thu, 27 May 2021 07:05:41 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> This patch provides a buffer to store asynchrounous messages and flush them to
>> underlying files periodically.
>
> 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.

Marked as reviewed by dholmes (Reviewer).

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.

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

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


More information about the hotspot-dev mailing list