Skip to content
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

[BazelProfile] More robust GC thread identification #111

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

saraadams
Copy link
Collaborator

The thread in which GC events are listed has been renamed multiple times, so the code for extracting the right thread by name is error-prone.
Instead of testing the name, search for the GC thread by its included events. This assumes that there is only one thread that contains GC events.

Contributes to #110

The thread in which GC events are listed has been renamed multiple
times, so the code for extracting the right thread by name is
error-prone.
Instead of testing the name, search for the GC thread by its included
events. This assumes that there is only one thread that contains GC events.

Contributes to #110

Signed-off-by: Sara Adams <[email protected]>
@saraadams
Copy link
Collaborator Author

Highlighted in bazelbuild/bazel#18548 (comment)
I may send a patch tomorrow to not require this PR, but the new logic might still be better

Comment on lines 183 to 185
.filter(event -> event.category.equals(BazelProfileConstants.CAT_GARBAGE_COLLECTION))
.findAny()
.isPresent();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use anyMatch((event) -> ... ) here

Signed-off-by: Sara Adams <[email protected]>
@saraadams saraadams merged commit a595c26 into main Nov 23, 2023
3 checks passed
@saraadams saraadams deleted the sara-garbage-collector-thread branch November 23, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants