-
Couldn't load subscription status.
- Fork 0
Prevent file descriptor leak and modernize BufferedWriter creation #39
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
base: master
Are you sure you want to change the base?
Prevent file descriptor leak and modernize BufferedWriter creation #39
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
⛔ Snyk checks have failed. 142 issues have been found so far.
⛔ security/snyk check is complete. 120 issues have been found. (View Details) ⛔ license/snyk check is complete. 22 issues have been found. (View Details) ✅ code/snyk check is complete. No issues have been found. (View Details) 💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
I'm confident in this change, but I'm not a maintainer of this project. Do you see any reason not to merge it? If this change was not helpful, or you have suggestions for improvements, please let me know! |
|
Just a friendly ping to remind you about this change. If there are concerns about it, we'd love to hear about them! |
This change prevents a file descriptor leak and modernizes the file writing API pattern.
The way the code is written now, the FileWriter never gets closed. Thus, it is up to the garbage collector's objection finalization process to close them at some point. This is not a good practice, and it can lead to a file descriptor leak. In hot code paths, it could cause exhaustion of all the available file descriptors for the system and lead to denial-of-service conditions.
Our changes look something like this:
More reading
🧚🤖 Powered by Pixeebot
Feedback | Community | Docs | Codemod ID: pixee:java/prevent-filewriter-leak-with-nio