-
Notifications
You must be signed in to change notification settings - Fork 12.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
Using ToSocketAddrs seems to remember EMFILE on the same thread #47955
Comments
Using |
Yea, I was providing some instructions on how we isolated it to likely being related to DNS. |
FWIW, it appears to work fine for me on Fedora 27 (glibc 2.26). I started the hyper
That's 16 == Also note that |
I have hit the same issue, and to test it I put together a small stand-alone reproducer: https://gist.github.com/miquels/c47316f7b19a0af3d9927bafef94de35 If I build and run this on debian 9/stretch, it shows the buggy behaviour. If I then run the same binary on debian 10/buster (aka "testing", not released yet) it works as expected. debian 9/stretch glibc version: 2.24 I ported the same reproducer to C, and sure enough, it shows the same behaviour. This is a bug in glibc that was fixed between 2.25 and 2.28. If I set I can fix this in the rust reproducer as well, by adding:
So if on_resolver_failure() added this workaround, it would probably solve this issue. |
Triage: Debian 9 EOL was June 2022, so I suggest we close this as obsolete. Or can anyone reproduce this on a still maintained OS version? |
RHEL 7 ELS is ongoing, which matches Rust's own minimum support of glibc 2.17, but I can't reproduce the problem there. |
This was noticed in hyperium/hyper#1422, where a user tried to trigger more connections than their allowed max file descriptors, and saw the EMFILE error. It was then noticed that afterwards, every call to
to_socket_addrs
that requires a DNS lookup would fail from then on. However, trying the same DNS lookup on a new thread would work fine.I was able to reproduce this using just the standard library here:
Just start up a local server, and try to run this program against it. Also, notice that if you change from
"localhost"
to"127.0.0.1"
, the issue doesn't show up.The text was updated successfully, but these errors were encountered: