-
Notifications
You must be signed in to change notification settings - Fork 193
Conversation
On shutting down, close all streams and send a GoAway frame to the endpoint.
I think the tests are failing because of sad window conditions in those tests. I'll see if I can make them more reliable, but I'm afraid it'll hold up merging in the meantime. =( |
@Lukasa no problem, let me know if you need any change on my side! |
In the short term, I've provided one small review note. Review status: 0 of 2 files reviewed, 1 unresolved discussion, some commit checks failed. hyper/http20/connection.py, line 598 [r1] (raw file): Comments from the review on Reviewable.io |
@jdecuyper (Sorry, trying out a new review tool, and you've unfortunately become my guineapig!) /cc @sigmavirus24 |
And apparently I forgot to actually mark the files reviewed. Review status: 0 of 2 files reviewed, 1 unresolved discussion, some commit checks failed. Comments from the review on Reviewable.io |
I'm a bit torn, mostly because I don't know HTTP/2 that well. The warning will be informative, but does the user want to know about this in the general case (where they likely don't have logging enabled). If the answer is "yes" it should be an exception. Otherwise, I completely defer to @Lukasa Review status: all files reviewed, 1 unresolved discussion, some commit checks failed.
Comments from the review on Reviewable.io |
If an unexpected stream id is received there is no need to punish the user by raising a protocol error. Instead we prefer to add a warning message and close that particular stream by sending a reset frame.
Review status: 0 of 3 files reviewed, all discussions resolved, some commit checks pending. hyper/http20/connection.py, line 598 [r1] (raw file): Comments from the review on Reviewable.io |
Review status: 0 of 3 files reviewed, 2 unresolved discussions, some commit checks pending. hyper/http20/errors.py, line 12 [r2] (raw file): Comments from the review on Reviewable.io |
Still no love from the build, is is related to my specific test or is it more about some race condition between all tests? |
It's a race condition in the tests, I'll nail them down today. Otherwise, this is looking great. Review status: all files reviewed, 3 unresolved discussions, some commit checks failed.
hyper/http20/connection.py, line 597 [r1] (raw file): log.warning(
"Unexpected stream identifier %s" % frame.stream_id
) hyper/http20/errors.py, line 12 [r2] (raw file): test/test_hyper.py, line 1273 [r2] (raw file): Comments from the review on Reviewable.io |
Aha, it is a race condition, but it's only possible because of this patch. It's also a legitimate test failure. We need to do two things here. First, The other thing you should do is add a Review status: all files reviewed, 4 unresolved discussions, some commit checks failed. hyper/http20/connection.py, line 249 [r2] (raw file): Comments from the review on Reviewable.io |
Review status: 1 of 3 files reviewed, all discussions resolved, some commit checks pending.
hyper/http20/connection.py, line 249 [r2] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed, 1 unresolved discussion, some commit checks pending.
test/test_hyper.py, line 1273 [r2] (raw file): Comments from the review on Reviewable.io |
Implement stylistic changes to the warnin messages. Use a valid endpoint stream identifier for the unexpected stream id test. Catch any exception when sending the GoAway frame during graceful shutdown. We can only do our best to send the GoAway frame as specified in the spec.
Alright, one tiny diff. We still have to fix the tests, but I'm happy to do that myself and point you at the diff so you can understand where the problem lies. =) It's not inherent in your code, just so you know. Review status: all files reviewed, 1 unresolved discussion, some commit checks failed.
hyper/http20/connection.py, line 254 [r3] (raw file): First, replace Next, let's save ourselves some code and write the whole block: except Exception as e:
log.warn("GoAway frame could not be sent: %s", % e) This is extremely nit-picky feedback, so if you don't believe you have time to handle it just let me know and I can apply that diff myself. Comments from the review on Reviewable.io |
Would be Review status: 2 of 3 files reviewed, all discussions resolved, some commit checks pending. hyper/http20/connection.py, line 254 [r3] (raw file): Comments from the review on Reviewable.io |
Would be glad to check where the problem lies, thanks! Review status: 2 of 3 files reviewed, 1 unresolved discussion, some commit checks pending. Comments from the review on Reviewable.io |
Alright, this looks great to me! 🍰 ✨ Review status: all files reviewed, all discussions resolved, some commit checks pending.
Comments from the review on Reviewable.io |
FYI @jdecuyper, this is the relevant commit that I believe will fix the tests. 21f6110 |
Fix for #15
GoAway
frame to the endpoint.PROTOCOL_ERROR
.