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

Close /proc/self/cgroup file after reading #1414

Merged
merged 1 commit into from
Mar 18, 2021
Merged

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Mar 17, 2021

While working on #1334, I noticed the test that checks if no file descriptions have been left open was failing intermittently.

This was happening because the Linux cgroups parsing code never closed the /proc file it opens. The real-world impact is small, as this file is only open once per application execution and its result cached after that. But there's no reason to keep the file open after its contents have been read.

This PR ensures that the file reading closes the file when it's done.

@marcotc marcotc added the bug Involves a bug label Mar 17, 2021
@marcotc marcotc self-assigned this Mar 17, 2021
@marcotc marcotc requested a review from a team March 17, 2021 20:46
Copy link
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

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

Great catch 👍

@marcotc marcotc merged commit b4e98fe into master Mar 18, 2021
@marcotc marcotc deleted the close-cgroup-file branch March 18, 2021 17:06
@github-actions github-actions bot added this to the 0.47.0 milestone Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants