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

GCToolKit#addDataSourceParser #288

Merged
6 commits merged into from
Apr 11, 2023
Merged

GCToolKit#addDataSourceParser #288

6 commits merged into from
Apr 11, 2023

Conversation

dsgrieve
Copy link
Member

@dsgrieve dsgrieve commented Apr 7, 2023

Using loadDataSourceParser causes the code to skip loading DataSourceParsers using the SPI. We added addDataSourceParser which adds a DataSourceParser to the ones that are loaded with the SPI. Along the way, we noticed that the Aggregators are loaded in such a way that they might never actually be used, which would lead to a hang because the Phaser in AbstractVirtualMachine might never be decremented for those Aggregators that are never used. So, a good deal of this change is to fix that issue, which we did by having the DataSourceParser report what events it produces (added DataSourceParser#producesEvents()). Now the code can check if any DataSourceParsers produce the events that an Aggregator aggregates. If not, the Aggregator is not used.

So... The files to focus on are GCToolkit and AbstractJavaVirtualMachine

@dsgrieve dsgrieve requested review from johnoliver, milderhc and a user April 7, 2023 18:37
this.completionTask = null;
if (t != null)
Executors.newSingleThreadExecutor().execute(t);
if (completionTask != null)
Copy link
Member Author

Choose a reason for hiding this comment

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

The reason for this change is that it is possible for an Aggregator to get events from more than one EventSource. If the completionTask is nulled out, then the Phaser only gets decremented by the first EventSource but not the subsequent EventSources.

The test CaptureJVMTerminationEventTest was hanging because of this issue.

Copy link
Member

@karianna karianna left a comment

Choose a reason for hiding this comment

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

I think DRY is being broken a little with the debugging implementation

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM....

@ghost ghost merged commit 27aad2d into main Apr 11, 2023
@ghost ghost deleted the rotating branch April 11, 2023 19:49
This pull request was closed.
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.

4 participants