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

[Enhancement] Method may fail to clean up stream or resource[WatchFileManagerTest] #4098

Closed
1 of 2 tasks
Alonexc opened this issue Jun 9, 2023 · 4 comments
Closed
1 of 2 tasks
Labels
enhancement New feature or request good first issue Issues for first-time contributors

Comments

@Alonexc
Copy link
Contributor

Alonexc commented Jun 9, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

Enhancement Request

image
located at:
eventmesh-common/src/test/java/org/apache/eventmesh/common/file/WatchFileManagerTest.java line 54,56
analysis and explanation:
The method creates an IO stream object, does not assign it to any fields, pass it to other methods that might close it, or return it, and does not appear to close the stream on all paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a finally block to ensure that streams are closed.

Describe the solution you'd like

use try-with-resources to manage resources.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@Ht12137
Copy link

Ht12137 commented Nov 7, 2023

I am new to the community,can i solve the problem?

@pandaapo
Copy link
Member

I am new to the community,can i solve the problem?

Because PR #4274 has not been modified according to the review for a long time, you can submit a new PR to complete this issue. Welcome!

因为PR #4274长时间没有按照review修改,您可以提交新的PR来完成该issue。欢迎!

@NiuXiangQian
Copy link

As a newbie, I would love to try to complete this fix job.

@Pil0tXia
Copy link
Member

Completed in #4716.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Issues for first-time contributors
Projects
None yet
6 participants