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

Volker Simonis simonis at openjdk.java.net
Wed May 26 10:45:26 UTC 2021


On Tue, 25 May 2021 05:23:56 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 two additional commits since the last revision:
> 
>  - Remove AsyncLogWriter::flush() from os::shutdown().
>    
>    When jvm aborts, it won't invoke AsyncLogWriter::flush() and guarantee
>    not to hinder the aborting process.
>    
>    Run all unified logging tests in async mode.
>  - Biased to the thread which is taking buffer lock.

Hi David,

is my understanding right that you're now fine with this change except for the question about potentially loosing logs in the case of an abort?

You have rightly argued that we don't want to wait an undefined amount of  time while we're in the process of aborting. As a consequence, Xin has removed the call to `AsyncLogWriter::flush()` from `os::shutdown()`. I think that's a good compromise because aborting is a rare event and even if aborting the probability of loosing log messages is very low. Using async logging already comes with the risk of loosing log messages in the case where the reserved buffer for async logging is too small. That's the tradeoff all users of async logging will have to pay for better latency. I don't think that the ultra-low probability of loosing logs in the case of a crash makes any difference for the general usability of this feature.

You've specifically asked for Thomas' opinion on this topic but he's out of the office for the next two weeks and I don't think that his absence should further block the integration of this patch. We've discussed this PR for more than two month in more than 250 messages. The PR has 4 approvals by now and I think it is really time to finally ship it.

Please let us know if you have any additional, sever objections? Otherwise it would be great if you could approve it as well.

Thank you and best regards,
Volker

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

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


More information about the hotspot-dev mailing list