You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2020/04/07 01:51:04 UTC

[trafficserver] branch 9.0.x updated: Don't be overly aggressive on stream failures and closing

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 714aefe  Don't be overly aggressive on stream failures and closing
714aefe is described below

commit 714aefe52a6311905f7ea6ce461547ee6227356f
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Tue Mar 17 11:38:35 2020 -0600

    Don't be overly aggressive on stream failures and closing
    
    (cherry picked from commit a96333192cd075ac23a08daa92f9254cde487bc7)
---
 proxy/http2/Http2ClientSession.cc  | 4 ++--
 proxy/http2/Http2ConnectionState.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc
index ceb06d2..da7d691 100644
--- a/proxy/http2/Http2ClientSession.cc
+++ b/proxy/http2/Http2ClientSession.cc
@@ -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)",
+              client_ip, connection_id(), this->connection_state.get_stream_error_rate(), Http2::stream_error_rate_threshold);
       err = Http2ErrorCode::HTTP2_ERROR_ENHANCE_YOUR_CALM;
     }
 
diff --git a/proxy/http2/Http2ConnectionState.h b/proxy/http2/Http2ConnectionState.h
index 8a83fa7..107d5e6 100644
--- a/proxy/http2/Http2ConnectionState.h
+++ b/proxy/http2/Http2ConnectionState.h
@@ -240,7 +240,8 @@ public:
   get_stream_error_rate() const
   {
     int total = get_stream_requests();
-    if (total > 0) {
+
+    if (total >= (1 / Http2::stream_error_rate_threshold)) {
       return (double)stream_error_count / (double)total;
     } else {
       return 0;