Skip to content
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

Remove error code and reason phrase from GOAWAY #355

Merged
merged 7 commits into from
Mar 8, 2017

Conversation

martinthomson
Copy link
Member

In an error condition, CONNECTION_CLOSE is your friend.

Closes #352. Builds on #354.

beyond the error code.
Last Server Stream ID:

: The last server-initiated Stream ID which was accepted by the sender of the
Copy link
Member

@LPardue LPardue Mar 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The last server-initiated Stream ID which was accepted by the sender of the GOAWAY frame" sounds a bit wonky.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, how about was created or will be created?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the sender isn't necessarily the server, and the client isn't "creating" server-initiated streams. Maybe we could say "the highest ... ID on which the sender has processed or will process data"? But that doesn't seem more compact, so I'm not sure it's an improvement.

But regardless, that's feedback on #354, not this change in particular.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have taken this feedback in and will update #354 with this. I found something else too.

martinthomson added a commit that referenced this pull request Mar 2, 2017
I have also added text that captures something we learned late in the HTTP/2
experience.  GOAWAY pre-emptively closes streams, but for peer-initiated
streams it might make sense to use a bigger number to allow any requests that
the peer created in the last round trip to complete.  Some implementations find
retrying quite difficult and allowing (for example) a client's last set of
requests to complete can make the shutdown properly graceful (as opposed to
toy-graceful).

The case where this matters is for a gateway to server, where the gateway can't
reasonably retry the 10,000 requests that it initiated in the last second. To
allow for that, the server can give the gateway a bit of extra leeway for those
streams when it sends a GOAWAY frame.

* Error Code: A 32-bit field error code which indicates the reason for closing
this connection.
Last Client Stream ID:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be biased towards Largest, instead of Last

in the GOAWAY frame can then be retried.

For peer-initiated streams, an endpoint might indicate a lower value for the
highest stream number than the value that might be sent by a peer. After
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think sending a GOAWAY in response does anything unless the peer receiving the GOAWAY wants to further decrease one or both of the Last Stream IDs, so typically I wouldn't expect this is necessary. As such, I'd recommend changing this to MAY and explain it's only if the Last Stream IDs are too large.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've kept this as a SHOULD but added the requested conditions. It's important that "safe" retries are enabled as much as possible and failure to echo will create unnecessary uncertainty. This is a big deal in HTTP.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to ack the GOAWAY, so why echo it, that would seem redundant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, now that I think about it, the only reason why you would reduce the largest stream number is because you didn't use those streams, and if you don't want to use those streams, then you can just not use them. Let's remove this paragraph.

@martinthomson martinthomson force-pushed the goaway_for_no_reason branch 2 times, most recently from c8a3a23 to 000ad01 Compare March 5, 2017 22:57
Copy link
Contributor

@ianswett ianswett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe GOAWAY is going away, but in the meantime, this looks good.

I have also taken the liberty of making the text that matches this
more directly applicable.
I have also added text that captures something we learned late in the HTTP/2
experience.  GOAWAY pre-emptively closes streams, but for peer-initiated
streams it might make sense to use a bigger number to allow any requests that
the peer created in the last round trip to complete.  Some implementations find
retrying quite difficult and allowing (for example) a client's last set of
requests to complete can make the shutdown properly graceful (as opposed to
toy-graceful).

The case where this matters is for a gateway to server, where the gateway can't
reasonably retry the 10,000 requests that it initiated in the last second. To
allow for that, the server can give the gateway a bit of extra leeway for those
streams when it sends a GOAWAY frame.
@janaiyengar janaiyengar merged commit 3afbc94 into master Mar 8, 2017
@MikeBishop MikeBishop deleted the goaway_for_no_reason branch March 10, 2017 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants