-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 #989
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for catching this.
Great catch! |
Exellent !-) |
H'mm I'm getting a too many open files issue with |
A file descriptor leaking issues. Could you debug this a little more? You can hack bcc to stop/wait right after the above error appears, and then check file descriptors usr /proc//fd and /proc//fdinfo. That will give a clue what hold on file descriptors. |
Hi it seems to increase by circa 7 file descriptors each time the timeout is reached for ustat - Please see attached file descriptor list and info ... obviously I did not wait for it to exhaust my file descriptor list - but you can see the picture ... |
there are a lot of bpf prog/map file descriptors. Maybe they should be closed but did not? I tried simple |
My ulimit is set by default for open files to (-n) 1024 uname -a Thanks, |
@drandynisbet Could you check whether the following change
fixed the issue or not? |
Hi - yes fixed it - many many thanks ... although I did remove my build directory - recreate it and reconfigure as there seemed to be multiple copies of init.py in the build directory and some were not updated with the change ... Cheers, |
Fix issue #989 When module is cleaned up, let us also close all bpf program file descriptors to avoid fd leaking. Signed-off-by: Yonghong Song <[email protected]>
Fix issue #989 When module is cleaned up, let us also close all bpf program file descriptors to avoid fd leaking. Signed-off-by: Yonghong Song <[email protected]>
If you keep
tools/ustat.py
running for more than 17min (with 1sec refresh) it errors out withtoo many open files
. Other tools may be affected.