-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8267952: async logging supports to dynamically change tags and decorators #4408
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
👋 Welcome back xliu! A progress list of the required criteria for merging this PR into |
Webrevs
|
Hi Xin, Unfortunately the new test is crashing: [ RUN ] LogConfigurationTest.reconfigure_decorators_MT_vm
I'll try to investigate more on Monday |
I think the fix for 8268165 is missing. That would explain the crashes. |
hi, Kim, Thanks for the head-up. I did prepare a patch to support Atomic::store. I think I followed what you guys did. Because this patch uses some C++ tricks(well, advanced techniques), I have to convince myself that it's necessary. so far, I found that it always generates the same store instructions in x86_64. @dholmes-ora As far as I known, there are 2 reasons why we can see that crash sight.
If so, synchronous logging should observe the same problem. The fact is we only observed the crash in AsyncLog Thread.
I have merged the master branch, which includes 8268165. Could you try it again and see if it will still crash at the same place? |
Mailing list message from David Holmes on hotspot-runtime-dev: On 14/06/2021 4:59 pm, Xin Liu wrote:
The updated branch passes the tier6 testing that previously failed. If David |
Thanks for the feedback. To be honest, I am not sure what the root cause is. Now I intend to believe it's an external factor which caused it fails. Those two tests don't trigger log rotation, but other gtests may do. Perhaps Oracle Linux mounts a small partition on /tmp. My comment is like "a theory of operation". I try to document the original author's intention. IMHO, it's thread-safe. [ RUN ] LogConfigurationTest.reconfigure_decorators_MT_vm
[ OK ] LogConfigurationTest.reconfigure_decorators_MT_vm (3601037 ms)
[ RUN ] LogConfigurationTest.reconfigure_tags_MT_vm
[ OK ] LogConfigurationTest.reconfigure_tags_MT_vm (3600112 ms) thanks, |
Mailing list message from David Holmes on hotspot-runtime-dev: On 15/06/2021 3:40 pm, Xin Liu wrote:
This time I got the old crash again in tier7: [ RUN ] LogConfigurationTest.reconfigure_decorators_MT_vm Stack: [0x00007f8834f2a000,0x00007f883502a000], sp=0x00007f8835028600, BTW: I noticed a separate bug in the crash log. You've defined: bool is_Named_thread() const override { return true; } for the AsyncLogWriter, but as you pointed out when I asked, this thread David |
1 similar comment
Mailing list message from David Holmes on hotspot-runtime-dev: On 15/06/2021 3:40 pm, Xin Liu wrote:
This time I got the old crash again in tier7: [ RUN ] LogConfigurationTest.reconfigure_decorators_MT_vm Stack: [0x00007f8834f2a000,0x00007f883502a000], sp=0x00007f8835028600, BTW: I noticed a separate bug in the crash log. You've defined: bool is_Named_thread() const override { return true; } for the AsyncLogWriter, but as you pointed out when I asked, this thread David |
Here is original answer: "NamedThread() is not just NonJavaThread with a name. It has some gc-specific fields. it seams NamedThread is for GC threads. Further, I don't need to support dynamic names." Yes, you're right. Sidetrack it here JDK-8268852. |
This patch also installed a sanity check which will assert that LogOutput::_decorators is subset of LogDecocrations. It will disclose more information if the assertion fails.
Mailing list message from David Holmes on hotspot-runtime-dev: Hi Xin, On 18/06/2021 9:29 am, Xin Liu wrote:
I'm putting these latest changes through tier6 and 7 testing - but there Looking at the code I still find it very difficult to see what actions David |
1 similar comment
Mailing list message from David Holmes on hotspot-runtime-dev: Hi Xin, On 18/06/2021 9:29 am, Xin Liu wrote:
I'm putting these latest changes through tier6 and 7 testing - but there Looking at the code I still find it very difficult to see what actions David |
Mailing list message from David Holmes on hotspot-runtime-dev: On 18/06/2021 12:00 pm, David Holmes wrote:
Not complete yet but the asynclogTest failed again: - one crash with the SEGV in flockfile David
|
Thank you. I see. we haven't solved any of two crash sights. |
…letion. This patch serializes all flush() calls in one thread.
Mailing list message from David Holmes on hotspot-runtime-dev: Hi Xin, On 23/06/2021 2:50 am, Xin Liu wrote:
I put this through our test system and tiers 6 and 7 also passed this way. So to walk through the fix ... When changing the configuration: In this way when the asyncLog thread finds the token it can signal the I think that seem okay. Only ever doing the writing in the asyncLog The only thing I need to double-check is whether there is any potential In the meantime, I would suggest closing this PR and opening a new one Thanks, |
1 similar comment
Mailing list message from David Holmes on hotspot-runtime-dev: Hi Xin, On 23/06/2021 2:50 am, Xin Liu wrote:
I put this through our test system and tiers 6 and 7 also passed this way. So to walk through the fix ... When changing the configuration: In this way when the asyncLog thread finds the token it can signal the I think that seem okay. Only ever doing the writing in the asyncLog The only thing I need to double-check is whether there is any potential In the meantime, I would suggest closing this PR and opening a new one Thanks, |
I understand your fix. You mark write() with keyword "synchonized in java" . One bonus is flush() is MT-safe as well. Yes, the benefit of token is that only one thread calls write(). It doesn't pay "synchronized" method cost if no flush() is invoked. I will pick one solution and remake the PR. thanks! |
Support dynamic reconfiguration for async logging. 2 unittests are provided.
The regression test discovers a race condition in LogTagSet::log() even with
synchronous logging. It's not MT-safe if context switch happens between the
creation of LogDecorations and LogOutputList::Iterator. fixed.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4408/head:pull/4408
$ git checkout pull/4408
Update a local copy of the PR:
$ git checkout pull/4408
$ git pull https://git.openjdk.java.net/jdk pull/4408/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4408
View PR using the GUI difftool:
$ git pr show -t 4408
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4408.diff