Skip to content

Conversation

@shinrich
Copy link
Member

This issue was identified while debugging new errors seen by an internal team after they enabled HTTP/2 in their client. On the backend, they saw an increase in the cases were ATS sends the origin the POST header but no POST body and then closes the connection.
With the addition of Error() messages we were able to see a case where the client is trying to open the 101'st stream on a session. This is beyond the 100 max concurrent stream limit, so ATS shuts down the session which kills the previous 100 streams.
A closer reading of section 5.1.2 of the spec (https://tools.ietf.org/html/rfc7540#section-5.1.2) indicates that this should be a stream error and not a connection error. Bryan Call, Masaori, and Maskit confirmed this interpretation. Maskit also noted that the other error case in the current createStream method must be treated as a connection error.
Presumably the client library is expecting the refused stream case so it can try again later.

The main change is in create_stream(). Added error messages through the H2Error() object to enable this debugging and future tracking down of error conditions.

@atsci
Copy link

atsci commented Dec 14, 2016

FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1265/ for details.

@atsci
Copy link

atsci commented Dec 14, 2016

Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/1160/ for details.

@bryancall bryancall added this to the 7.1.0 milestone Dec 22, 2016
Copy link
Member

@maskit maskit left a comment

Choose a reason for hiding this comment

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

The fix for the original issue seems good, but there are few unnecessary changes, and a typo.

}
if (stream->server_rwnd < payload_length) {
return Http2Error(HTTP2_ERROR_CLASS_STREAM, HTTP2_ERROR_FLOW_CONTROL_ERROR);
return Http2Error(HTTP2_ERROR_CLASS_STREAM, HTTP2_ERROR_FLOW_CONTROL_ERROR, "recvdata stream->server_rwnd < payload_length");
Copy link
Member

Choose a reason for hiding this comment

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

"recv data" -- please add a space.


DebugHttp2Stream(cstate.ua_session, stream_id, "Received CONTINUATION frame");

// Error("http2_cs [%" PRId64 "] Received RST_STREAM frame for %d", cs.connection_id(), stream_id);
Copy link
Member

Choose a reason for hiding this comment

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

This line should not be necessary.

return Http2Error(HTTP2_ERROR_CLASS_CONNECTION, HTTP2_ERROR_ENHANCE_YOUR_CALM, "continuation enhance your calm");
} else {
return Http2Error(HTTP2_ERROR_CLASS_STREAM, HTTP2_ERROR_PROTOCOL_ERROR);
return Http2Error(HTTP2_ERROR_CLASS_CONNECTION, HTTP2_ERROR_PROTOCOL_ERROR, "continuation decode error");
Copy link
Member

Choose a reason for hiding this comment

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

This case is actually not for a decode error but HTTP2 violation, such as using uppercase in header names. All decode errors should be handled as compression error. We don't have to abandon all following requests with a connection error, because the HPACK decoder instance keeps valid status. Please see 8.1.2.6.

I'd put a message like "continuation malformed request".

return Http2Error(HTTP2_ERROR_CLASS_CONNECTION, HTTP2_ERROR_ENHANCE_YOUR_CALM, "recv headers enhance your calm");
} else {
return Http2Error(HTTP2_ERROR_CLASS_STREAM, HTTP2_ERROR_PROTOCOL_ERROR);
return Http2Error(HTTP2_ERROR_CLASS_STREAM, HTTP2_ERROR_PROTOCOL_ERROR, "recv headers decode error");
Copy link
Member

Choose a reason for hiding this comment

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

This is not a decode error. Please see a comment for the same logic in rcv_continuation_frame.

@shinrich
Copy link
Member Author

shinrich commented Jan 4, 2017

Pushed new commit (squashed) to address maskit's comments.

@atsci
Copy link

atsci commented Jan 4, 2017

FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1292/ for details.

@atsci
Copy link

atsci commented Jan 4, 2017

Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/1185/ for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants