-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8267517: async logging for stdout and stderr #6132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This patch refactors logFileStreamOutput and make stdout/stderr support async logging. This patch also removes FileLocker for asynclogging. There's only one thread write logs.
Log rotation only happens in LogFileOutput::flush().This fixes the regression test 'serviceability/logging/TestLogRotation.java'.
we don't need Atomic::add for _current_size because it's synchronized.
This patch fixes two regressions. they have more than 1 active logging outputs. serviceability/logging/TestFullNames.java serviceability/logging/TestQuotedLogOutputs.java Please enter the commit message for your changes. Lines starting
👋 Welcome back xliu! A progress list of the required criteria for merging this PR into |
@navyxliu This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
taskset 0x1 make test TEST='runtime/logging/BlockedLoggingTest.java'
Webrevs
|
Hello, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Xin,
I took a look at this but to be honest I couldn't work out what most of the changes actually had to do with the topic of adding async logging for stdout/stderr. IIUC the change from LogFileOutput
to LogFileStreamOutput
in the API now enables it to be used for stdout/stderr - right? But most of the changes seemed to relate to log file rotation which doesn't even apply to stdout/stderr! What has force_rotation got to do with things?
David
Sorry, this is my fault. This patch incorporates with JDK-8275083. They are so intertwined that I can't split them. |
hi, @dholmes-ora , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Xin,
I think I get the gist of what this is doing now - thanks. A few minor comments below. I'm not sure about the robustness of the test, in particular whether destroyForcibly will be reliable enough on all platform. I will take it for a spin through our CI system.
Thanks,
David
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry Xin, the test is timing out on Linux-x64. There's no information to diagnose any problems though.
David
This is a good question! you are right. I shouldn't provide "write_blocking" functions with 2 different semantics. That will confuse everybody including me. This can be done. |
…ynclog.cpp. This patch also adds to flushing semantic to LogFileStreamOutput::write_blocking(). It aligns with LogFileOutput::write_blocking().
hi, @dholmes-ora , I come up an idea to prove that -Xlog:async at work. In gtest In this revision, write_blocking() has flushing semantic for both LFO and LFSO. Could you take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest version looks good to me. I'm running it through our CI testing.
Thanks,
David
@navyxliu This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 104 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Testing results were fine. |
@dholmes-ora @YaSuenag |
/integrate |
Going to push as commit 7aff03a.
Your commit was automatically rebased without conflicts. |
This patch refactors LogFileStreamOutput so stdout/stderr can support support -Xlog:async.
With
-Xlog:all=trace:stdout
, the helloworld in Java outputs 16520 log entries to stdout. We are see that the wall time reduces from 84.138ms to 72.914ms, or the throughput increases 15% because of async logging.The easiest test of stdout with AsyncLogging is to use tty and XOFF Ctrl^s. Java applications with UL to stdout were blocked by Ctrl-s. The entire java process will be frozen. -Xlog:async now cover both stdout and stderr. It can circumvent this issue.
Add a new jtreg to cover a scenario that unified logging with -Xlog:async will not be frozen even when stdout is blocked.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6132/head:pull/6132
$ git checkout pull/6132
Update a local copy of the PR:
$ git checkout pull/6132
$ git pull https://git.openjdk.java.net/jdk pull/6132/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6132
View PR using the GUI difftool:
$ git pr show -t 6132
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6132.diff