Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions proxy/http2/Http2ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ Http2ClientSession::state_process_frame_read(int event, VIO *vio, bool inside_fr
ip_port_text_buffer ipb;
const char *client_ip = ats_ip_ntop(get_client_addr(), ipb, sizeof(ipb));
Warning("HTTP/2 session error client_ip=%s session_id=%" PRId64
" closing a connection, because its stream error rate (%f) is too high",
client_ip, connection_id(), this->connection_state.get_stream_error_rate());
" closing a connection, because its stream error rate (%f) exceeded the threshold (%f)",
Copy link
Contributor Author

@zwoop zwoop Mar 17, 2020

Choose a reason for hiding this comment

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

This was only done to make the Warning() consistent with the other two places we do this check.

Copy link
Member

Choose a reason for hiding this comment

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

Adding configured threshold value is fine, but removing "too high" would make it hard to see whether the close was graceful or immediate.

client_ip, connection_id(), this->connection_state.get_stream_error_rate(), Http2::stream_error_rate_threshold);
err = Http2ErrorCode::HTTP2_ERROR_ENHANCE_YOUR_CALM;
}

Expand Down
3 changes: 2 additions & 1 deletion proxy/http2/Http2ConnectionState.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ class Http2ConnectionState : public Continuation
get_stream_error_rate() const
{
int total = get_stream_requests();
if (total > 0) {

if (total >= (1 / Http2::stream_error_rate_threshold)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The point of this is to require a minimum number of samples before we can calculate a reasonably trustworthy rate of failures. The smaller the threshold, the more samples needed. Probably not statistically safe, but this at least avoids the issues where if (in the default configs) any of the first 10 streams has an error, it's enough to close the connection.

return (double)stream_error_count / (double)total;
} else {
return 0;
Expand Down