You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2015/08/26 17:49:20 UTC

trafficserver git commit: TS-3842: Add stats for HTTP/2 errors Stating more errors

Repository: trafficserver
Updated Branches:
  refs/heads/master 5ef29dd2f -> 73dca1132


TS-3842: Add stats for HTTP/2 errors
Stating more errors


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/73dca113
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/73dca113
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/73dca113

Branch: refs/heads/master
Commit: 73dca11323f7286e394bbcb23abc7013e0fa0e41
Parents: 5ef29dd
Author: Bryan Call <bc...@apache.org>
Authored: Wed Aug 26 08:47:39 2015 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Aug 26 08:47:39 2015 -0700

----------------------------------------------------------------------
 proxy/http2/Http2ConnectionState.cc | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/73dca113/proxy/http2/Http2ConnectionState.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 9714ee4..e14f005 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -740,9 +740,7 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
     }
 
     if (error.cls != HTTP2_ERROR_CLASS_NONE) {
-      EThread *ethread = this_ethread();
       if (error.cls == HTTP2_ERROR_CLASS_CONNECTION) {
-        HTTP2_INCREMENT_THREAD_DYN_STAT(HTTP2_STAT_CONNECTION_ERRORS_COUNT, ethread);
         this->send_goaway_frame(last_streamid, error.code);
         cleanup_streams();
         // XXX We need to think a bit harder about how to coordinate the client
@@ -754,7 +752,6 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
         // half-closed state ...
         SET_HANDLER(&Http2ConnectionState::state_closed);
       } else if (error.cls == HTTP2_ERROR_CLASS_STREAM) {
-        HTTP2_INCREMENT_THREAD_DYN_STAT(HTTP2_STAT_STREAM_ERRORS_COUNT, ethread);
         this->send_rst_stream_frame(last_streamid, error.code);
       }
     }
@@ -1006,6 +1003,10 @@ Http2ConnectionState::send_rst_stream_frame(Http2StreamId id, Http2ErrorCode ec)
 {
   DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send RST_STREAM frame.", this->ua_session->connection_id());
 
+  if (ec != HTTP2_ERROR_NO_ERROR) {
+    HTTP2_INCREMENT_THREAD_DYN_STAT(HTTP2_STAT_STREAM_ERRORS_COUNT, this_ethread());
+  }
+
   Http2Frame rst_stream(HTTP2_FRAME_TYPE_RST_STREAM, id, 0);
 
   rst_stream.alloc(buffer_size_index[HTTP2_FRAME_TYPE_RST_STREAM]);
@@ -1073,6 +1074,10 @@ Http2ConnectionState::send_goaway_frame(Http2StreamId id, Http2ErrorCode ec)
 {
   DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send GOAWAY frame.", this->ua_session->connection_id());
 
+  if (ec != HTTP2_ERROR_NO_ERROR) {
+    HTTP2_INCREMENT_THREAD_DYN_STAT(HTTP2_STAT_CONNECTION_ERRORS_COUNT, this_ethread());
+  }
+
   Http2Frame frame(HTTP2_FRAME_TYPE_GOAWAY, 0, 0);
   Http2Goaway goaway;