Skip to content

[#6513] fix resource leak in BaseCatalog #6980

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yunchipang
Copy link
Contributor

What changes were proposed in this pull request?

Use a try-with-resources pattern to ensure the BaseAuthorization object is automatically closed when execution exits the try block, regardless of whether it completes normally or due to an exception.

Why are the changes needed?

To prevent memory leak.

Fix: #6513

Does this PR introduce any user-facing change?

No.

How was this patch tested?

(Please test your changes, and provide instructions on how to test it:

  1. If you add a feature or fix a bug, add a test to cover your changes.
  2. If you fix a flaky test, repeat it for many times to prove it works.)

@jerqi
Copy link
Contributor

jerqi commented Apr 22, 2025

Like last discussion, the Authorization is like a factory class. It's a little weird to have the method close.

@yunchipang
Copy link
Contributor Author

@jerqi thanks for reviewing. I think i was not involved in the discussion. Are we closing the issue then? Feel free to close #6513 if it's no longer valid.

@xunliu
Copy link
Member

xunliu commented Apr 23, 2025

@jerryshao What do you think?

@xunliu xunliu requested a review from jerryshao April 23, 2025 03:42
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.

[Improvement] Possible resource leak in BaseCatalog.java
3 participants