-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8231627: ThreadsListHandleInErrorHandlingTest.java fails in printing all threads #1891
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
…ava fails because error occurred during printing all threads
|
/label add hotspot-runtime serviceability |
|
👋 Welcome back dcubed! A progress list of the required criteria for merging this PR into |
|
@dcubed-ojdk The |
|
@dholmes-ora, @fisk and @robehn - You folks might be interested in this |
Webrevs
|
fisk
left a comment
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.
Looks good. We have something similar in the precious GC log code during error reporting.
|
@dcubed-ojdk 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 50 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 |
|
@fisk - Thanks for the review! And Merry Christmas Eve!! |
Merry Christmas to you too Dan! |
|
Ping! I could use a second review here... |
coleenp
left a comment
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.
Looks good. One comment. Also, ha ha, Harold caught me today: you need to update the copyrights!
| } | ||
| return; | ||
| } | ||
| st->print_cr("_java_thread_list_alloc_cnt=" UINT64_FORMAT ", " |
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.
Are these statistics stable if you don't have the Threads_lock? Seems like a good place to return unconditionally to me, but it's up to you whether this is wrong and it matters. It doesn't follow any pointers so doesn't look like it'll crash.
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.
No the statistics starting on L1161 are not stable if we don't
have the Threads_lock. That's why we detect a change in the
_java_thread_list on L1194 and print a message:
if (_java_thread_list != saved_threads_list) {
st->print_cr("The _java_thread_list has changed from " INTPTR_FORMAT
" to " INTPTR_FORMAT
" so some of the above information may be stale.",
p2i(saved_threads_list), p2i(_java_thread_list));
}
|
Maybe the PR/JBS title should be shortened to "ThreadsListHandleInErrorHandlingTest.java fails in printing all threads" for conciseness and to make GitHub happy? |
pchilano
left a comment
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 Dan,
Looks good to me!
| } | ||
|
|
||
| if (_to_delete_list != NULL) { | ||
| if (has_Threads_lock) { |
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.
Shouldn't we check for Threads_lock->owned_by_self() instead? (case where thread already owns Threads_lock before calling print_info_on()).
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.
Good idea! That will cover one more "safe" case, but I'll want to rename
the new has_Threads_lock to something else.
| st->print_cr("Skipping _to_delete_list fields and contents for safety."); | ||
| } | ||
| } | ||
| if (!EnableThreadSMRStatistics) { |
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.
You could switch to "if(EnableThreadSMRStatistics)" instead and put this code at the end to avoid repetition. Also I think the comparison with _java_thread_list could be done unconditionally at the end since it's already racy anyways (even if the info was printed with the Threads_lock held it could have changed right after it's released and before returning).
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.
I like the refactoring suggestion from Patricio above to switch to "if(EnableThreadSMRStatistics)". The code will be a little more elegant.
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.
Done.
sspitsyn
left a comment
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 Dan,
It looks good modulo a couple of suggestions from Patricio.
Thanks,
Serguei
|
Made copyright changes based on comments from coleenp, |
|
Passed local builds and testing on my MBP13. A Mach5 Tier1 has finished all Please re-review when you get the chance. |
coleenp
left a comment
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.
LGTM!
|
Looks good, thanks Dan! |
|
sspitsyn, coleenp, and pchilano - Thanks for the re-reviews! My local Linux-X64 build and test went fine. My Mach5 Tier1 passed |
|
/integrate |
|
@dcubed-ojdk Since your change was applied there have been 55 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit c0540ff. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
A small robustness fix in ThreadsSMRSupport::print_info_on() to reduce the
likelihood of crashes during error reporting. Uses Threads_lock->try_lock()
for safety and restricts some reporting to when the Threads_lock has been
acquired (depends on JDK-8256383). Uses a ThreadsListHandle to make
the current ThreadsList safe for reporting (depends on JDK-8258284). Also
detects when the system ThreadsList (_java_thread_list) has changed and
will warn that some of the reported info may now be stale.
Two existing tests have been updated to reflect the use of a ThreadsListHandle
in ThreadsSMRSupport::print_info_on(). Mach5 Tier[1-6] testing has no regressions.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1891/head:pull/1891$ git checkout pull/1891