-
Notifications
You must be signed in to change notification settings - Fork 31
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
Connections might be silentrly not served #59
Comments
Hmm, bug confirmed. But when I tried to run it in debug mode, and I found it works pretty well
and if I run it with
Update: Oh! It will also happen in debug mode! |
Interestingly ... The problem is:
It would be:
|
Tried with https://github.com/carllerche/mio.git#c3069801, problem still exists. Although, after making this change:
I see multiple versions of many crate in output of
So am I not sure whether mio master was used at all :) |
I found a bug in the event notifier (Condvar), which will drop the event notification if no coroutine is waiting on it. Please try again, this bug should be fixed. |
I can confirm that no timeouts happening anymore. Performance is also superb, with slowdown being just 8%:
Although achieved at the cost of much higher CPU utilisation:
|
There are still lots of work to do, :) |
That is kinda worst case scenario - no userspace work is done here. in more realistic scenarios relative overhead will go down, while benefits of multicore processing will shoot up. Bug like this scary though, can be missed easily, we were lucky to be able to trigger it relatively easy. Would it be possible to create a test case for problems like that? Custom condvars, spinlocks, notifies - all of that might break simply because just 2 pair of eyes are looking into them, it doesn't add confidence I admit :( EDIT: grammar |
Hmm, the current implementation is just a temporary solution, we wanted to make it work just like Go's Cond implementation but failed to compile. So I committed to make it compile and work without any self-tests. That's my fault. We will continue working on this, but currently we are focus more on #56 . |
On current master (7d12511), simple echo server might "forget" to serve response to certain clients, no erros are reported on server side, tcp connection is not dropped either.
This is very racey and you might need to play with params to trigger it more or less reliably on your machines. Params I am using in my Core i3 M370 (2 cores + 2 HT):
server:
client:
New
-d
param specifies read/write timeout and was added in #58Output:
It is not happening on every run, but I found that it happens more often when client opens less connections.
UPD1: it is not a performance issue, set timeout to "60s", you'll see that test completes, no more active communication happens, yet few connections remain waiting to read data back indefinitely.
The text was updated successfully, but these errors were encountered: