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

fix potential resource leak. #1922

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

Conversation

yu-shipit
Copy link
Contributor

@yu-shipit yu-shipit commented Dec 25, 2024

The rows() is a closable resources. We can use Using to protect it. However, the current logic calls rows() twice and only close it once. This commit would fix this issue.

Pull Request checklist

  • The commit(s) message(s) follows the contribution guidelines ?
  • Tests for the changes have been added (for bug fixes / features) ?
  • Docs have been added / updated (for bug fixes / features) ?

Current behavior : (link exiting issues here : https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests)

Potential resource leak due to unclosed resources.

New behavior :
Resource leak fixed.

BREAKING CHANGES

If this PR contains a breaking change, please describe the impact and migration
path for existing applications.
If not please remove this section.

Breaking changes may include:

  • Any schema changes to any Cassandra tables
  • The serialized format for Dataset and Column (see .toString methods)
  • Over the wire formats for Akka messages / case classes
  • Changes to the HTTP public API
  • Changes to query parsing / PromQL parsing

Other information:

@yu-shipit yu-shipit force-pushed the closeFix branch 3 times, most recently from d27af2d to b1c3360 Compare December 25, 2024 20:12
The rows() is a closable resources. We can use Using to protect it.
However, the current logic calls rows() twice and only close it once.
This commit would fix this issue.
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.

1 participant