-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Manage InnerEndpoint timers with a DelayQueue #80
Conversation
This is my attempt at fixing #64 There are also two unrelated clippy fixes but I can remove them from the PR if you prefer. |
I hope I'm not changing the behavior here. It would be helpful to have tests for this kind of things. I have some experience in python and QA, so if that fits your plan, I can probably automate testing a bit. I'd have to read the RFCs first but let me know if you're interested. |
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.
This looks great, thanks! Just a few possible tweaks. Cosmetic clean-up is always welcome, especially when gracefully isolated from other changes.
It looks like you preserved the behavior fine, and I'll do some manual testing before I merge. While the state machine in quinn-proto has a decent number of tests, these higher-level tokio bindings are definitely missing some tests of their own; some end-to-end tests would be very welcome. Originally I'd hoped that the bindings would be simple to the point of obviousness but that hasn't quite worked out. I don't think you'd need a deep understanding of the protocol for basic smoke tests, which can just use the high-level API like the examples do. See also #59.
Also, it looks like you're running a mismatched version of rustfmt. We're standardized on the current stable release. |
87b80a4
to
76f8cf0
Compare
Codecov Report
@@ Coverage Diff @@
## master #80 +/- ##
==========================================
+ Coverage 56.65% 57.48% +0.82%
==========================================
Files 17 17
Lines 4423 4436 +13
==========================================
+ Hits 2506 2550 +44
+ Misses 1917 1886 -31
Continue to review full report at Codecov.
|
Ah thank you, I was a bit confused. I amended the last commit. I'll address the rest of your comment tomorrow morning. Thank you for the thorough review, it's much appreciated :) |
Actually, #78 already fixes the formatting problems, so if we merge that and this PR gets rebased on top of that we don't need the extraneous commit anymore. |
70853ac
to
1251ae4
Compare
I removed the rustfmt commit, and addressed the comments (except the |
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.
Second pass, just some cosmetics. #78 is merged, so we should be good to go afterwards.
1251ae4
to
31f61a0
Compare
Running the example client/server produces a panic at the |
Sorry I should have run that first. I don't really understand the code at https://docs.rs/tokio-timer/0.2.7/src/tokio_timer/delay_queue.rs.html#502 I'll try to reproduce this on a small example to get a better understanding of what triggers the panic. |
It seems that a timer is being reset after it should have already expired. It's not obvious to me why this is deemed panic-worthy by DelayQueue, but I'm also surprised that it's happening in the first place. |
One scenario: when timers are polled we may have an expired timer, but we don't reset while let Some(io) = endpoint.inner.poll_io(now) { we may use a key for an expired timer. I'm seeing something like that in the server:
However for the client I'm not seeing that. There's something weird though:
|
be61100
to
edbdad2
Compare
Great catch! That's almost certainly the root cause.
Timer 1 was probably removed due to a |
I fixed the "invalid key" panic. But the client still crashes consistently, and the server once in a while. |
If you enable trace logging in slog (replace the slog line with
Note 1ms difference in time before LossDetection's old value is deemed nonsensical, despite it still theoretically being about 37ms in the future. Hmmm. |
Thanks for the tip with |
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.
These changes may be causing additional confusion.
6d64769
to
b9b9231
Compare
b9b9231
to
23bba11
Compare
sorry for the confusion I was trying things to see if that got rid of the error. I cleaned things up a little and squashed the commits. |
So what's the status here? How do we move forward? |
I need to repro the panic in |
No worries, good luck wih the move! |
I think this will become blocking soon, do you still have time to work on this in the next week or so? If not, I'll build on your work and finish it off. |
I'm having another go with this in the course of experimenting with async/await, and am making progress on narrowing down a root cause: tokio-rs/tokio#849 |
Testing on the nightly branch suggests that |
Mooted by #264 |
No description provided.