Skip to content

fix(config): close resource streams#45

Open
Federico2014 wants to merge 1 commit into
release_v4.8.2from
fix/close-resource-streams
Open

fix(config): close resource streams#45
Federico2014 wants to merge 1 commit into
release_v4.8.2from
fix/close-resource-streams

Conversation

@Federico2014

@Federico2014 Federico2014 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

This PR fixes resource stream handling in configuration and startup utility code. It replaces a classpath resource existence check with getResource(), wraps git.properties resource loading in try-with-resources, and closes the zk parameter resource stream after copying it to a temporary file.

Why are these changes required?

Some getResourceAsStream() call sites opened resource streams without closing them. This can leak file handles or jar resource handles in long-running processes or repeated utility calls. The zk parameter loading path also now fails clearly when the expected resource is missing instead of passing a null stream into file copy logic.

This PR has been tested by:

  • Unit Tests
  • Manual Testing: git diff --check
  • Manual Testing: ./gradlew :common:compileJava :framework:compileJava

Follow up

None.

Extra details

This PR does not change configuration semantics. It only avoids unnecessary stream creation and ensures opened classpath resource streams are closed.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0e023de6-9346-4464-9792-2d67b9e9628c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/close-resource-streams

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

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