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 file descriptor leak on LinuxBrokerHostUsageImpl #179

Merged
merged 1 commit into from
Jan 30, 2017

Conversation

sschepens
Copy link
Contributor

Motivation

LinuxBrokerHostUsageImpl is leaking file descriptors when reading /proc/stats and when reading files in /sys/class/net.
It's counter-intuitive, but java file streams must be closed, reference.

Modifications

Stream now are opened using try-with-resource.

Result

There should be no more file descriptor leaks.

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

Looks good, nice catch!

@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Jan 30, 2017
@merlimat merlimat added this to the 1.16 milestone Jan 30, 2017
@merlimat merlimat merged commit 7f92ae6 into apache:master Jan 30, 2017
@sschepens sschepens deleted the fix_file_descriptor_leak branch January 30, 2017 18:05
sijie pushed a commit to sijie/pulsar that referenced this pull request Mar 4, 2018
hrsakai pushed a commit to hrsakai/pulsar that referenced this pull request Dec 10, 2020
Signed-off-by: xiaolong.ran <rxl@apache.org>

### Modifications

Fix concurrent map read and map write
zzzming pushed a commit to zzzming/pulsar that referenced this pull request Jun 5, 2023
michaeljmarshall pushed a commit to michaeljmarshall/pulsar that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants