-
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
Runtime Failures on TCP Stress Testing: (libuv) kqueue(): Too many open files
and more
#12666
Comments
Oh dear that's bad, thanks for the small issue! I will definitely investigate. |
What is the result of |
@bharrisau you're right!
So I set it to a higher value and things seem fine now. Sorry about that. Though, It's still a surprising way for the runtime to fail, and clearly something is still wrong there. |
Despite OSX having small file descriptor limits, this is a serious bug that I'd like to address with the runtime. Something funny is going on. |
This commit fixes a small bug in the green scheduler where a scheduler task calling `maybe_yield` would trip the assertion that `self.yield_check_count > 0` This behavior was seen when a scheduler task was scheduled many times successively, sending messages in a loop (via the channel `send` method), which in turn invokes `maybe_yield`. Yielding on a sched task doesn't make sense because as soon as it's done it will implicitly do a yield, and for this reason the yield check is just skipped if it's a sched task. I am unable to create a reliable test for this behavior, as there's no direct way to have control over the scheduler tasks. cc rust-lang#12666, I discovered this when investigating that issue
With #12818 applied, I am unable to reproduce this on OSX. I am not convinced that it fixes anything, but I'm no longer seeing any scary assertions. |
I take that back, I was using |
I attempted to debug this issue on linux, and I quickly ran into two problems. The first is an assertion fixed by #12818, and the other is filed as joyent/libuv#1189. Sadly none of this seems related to the assertions on OSX, so I'll continue to investigate there. If only OSX still had valgrind... |
This commit fixes a small bug in the green scheduler where a scheduler task calling `maybe_yield` would trip the assertion that `self.yield_check_count > 0` This behavior was seen when a scheduler task was scheduled many times successively, sending messages in a loop (via the channel `send` method), which in turn invokes `maybe_yield`. Yielding on a sched task doesn't make sense because as soon as it's done it will implicitly do a yield, and for this reason the yield check is just skipped if it's a sched task. I am unable to create a reliable test for this behavior, as there's no direct way to have control over the scheduler tasks. cc rust-lang#12666, I discovered this when investigating that issue
If a TTY fails to get initialized, it still needs to have uv_close invoked on it. This fixes the problem by constructing the TtyWatcher struct before the call to uv_tty_init. The struct has a destructor on it which will close the handle properly. Closes #12666
I'm on OSX 10.8.4, x86_64, latest Rust on master. And to head off any concerns about my file handle limits:
I ran into this when stress-testing my web sockets library. After just a couple hundred connections, some connections were being refused at random. The only thing I could see was some output with
RUST_LOG=debug
saying(libuv) kqueue(): Too many open files
. I've come up with a smaller test case that brings this out with some spectacular errors:Fails less often with 100-200 connections. The errors are different every time I run this with
RUST_LOG=debug
.Here's the end of one run:
Another:
Another:
And lastly:
The text was updated successfully, but these errors were encountered: