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

Ensure that all AutoCloseable binders are closed #42388

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Aug 8, 2024

The OOM in the issue was caused by a class being help in a notification listener queue for JMX messages.
The fix is simply to remove close the binder that then removes the listener.

Copy link

quarkus-bot bot commented Aug 8, 2024

/cc @brunobat (micrometer), @ebullient (micrometer)

Copy link

quarkus-bot bot commented Aug 8, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit dde46df.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@geoand geoand requested a review from gsmet August 8, 2024 06:20
@geoand geoand added triage/waiting-for-ci Ready to merge when CI successfully finishes triage/backport and removed triage/waiting-for-ci Ready to merge when CI successfully finishes labels Aug 8, 2024
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

I added a thought but feel free to ignore and merge :).

Thanks for tracking this!

new JvmGcMetrics().bindTo(Metrics.globalRegistry);
JvmGcMetrics jvmGcMetrics = new JvmGcMetrics();
jvmGcMetrics.bindTo(Metrics.globalRegistry);
autoCloseables.add(jvmGcMetrics);
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if I would add all the listeners to a List and then close them if they are Closeable or AutoCloseable. That might be more future proof.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand where the desire for defensiveness against such OOMs is coming from, but in this case, I think it's overkill.

In reality, this issue was being flagged by IntelliJ (as the auto-closable was never being closed), we just didn't pay attention - and we absolutely should next time :)

@geoand geoand merged commit 9bd1911 into quarkusio:main Aug 8, 2024
28 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.14 - main milestone Aug 8, 2024
@geoand geoand deleted the #42355-take2 branch August 8, 2024 07:18
@gsmet gsmet modified the milestones: 3.14 - main, 3.13.2 Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OOM in tests since Quarkus 3.13.0 (Part 2)
2 participants