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

File handles don't get closed #38

Closed
haslersn opened this issue Oct 13, 2019 · 3 comments
Closed

File handles don't get closed #38

haslersn opened this issue Oct 13, 2019 · 3 comments

Comments

@haslersn
Copy link

haslersn commented Oct 13, 2019

I have a program that uses this ldap3 library so as to regularly create an ldap connection. Each time a file descriptor is opened, as can be seen in /proc/<PID>/fd. Unfortunately, those file descriptors are never closed, even if the corresponding handle to the connection (in the Rust code) is dropped. They are leaked. Therefore, the program eventually runs out of file descriptors and crashes.

@inejge
Copy link
Owner

inejge commented Oct 15, 2019

I believe this is a bug in tokio. Try setting it explicitly to 0.1.11, which is (from my testing) the last version that drops the Core as expected.

[dependencies]
tokio = "=0.1.11"

@haslersn
Copy link
Author

haslersn commented Jan 2, 2020

I believe this is a bug in tokio. Try setting it explicitly to 0.1.11, which is (from my testing) the last version that drops the Core as expected.

[dependencies]
tokio = "=0.1.11"

Thanks, that did the trick.

@inejge
Copy link
Owner

inejge commented Apr 28, 2020

With the port to Tokio 0.2, this can now be closed. I've tested the new version by opening and dropping a connection in a tight loop, which would have exhausted the available file descriptors in under a second if there was a leak. There wasn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants