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 2017/10/30 15:58:35 UTC

[trafficserver] branch 7.1.x updated: Prevent releasing streams simultaneously

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

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


The following commit(s) were added to refs/heads/7.1.x by this push:
     new 9a58cad  Prevent releasing streams simultaneously
9a58cad is described below

commit 9a58cadb398153515c152ce87938cdab9c3a91cf
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Mon Oct 30 11:45:12 2017 +0900

    Prevent releasing streams simultaneously
    
    (cherry picked from commit 495be0ece38d0699e7e00b70b570eb7ddc30c4d5)
---
 proxy/http2/Http2ClientSession.cc | 6 +++++-
 proxy/http2/Http2Stream.cc        | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc
index f545918..792279e 100644
--- a/proxy/http2/Http2ClientSession.cc
+++ b/proxy/http2/Http2ClientSession.cc
@@ -279,7 +279,11 @@ Http2ClientSession::do_io_close(int alerrno)
     client_vc->do_io_close();
     client_vc = nullptr;
   }
-  this->connection_state.release_stream(nullptr);
+
+  {
+    SCOPED_MUTEX_LOCK(lock, this->connection_state.mutex, this_ethread());
+    this->connection_state.release_stream(nullptr);
+  }
 }
 
 void
diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index 33ed6af..dc30e78 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -662,6 +662,7 @@ Http2Stream::destroy()
     // release_stream and delete_stream indirectly call each other and seem to have a lot of commonality
     // Should get resolved at somepoint.
     Http2ClientSession *h2_parent = static_cast<Http2ClientSession *>(parent);
+    SCOPED_MUTEX_LOCK(lock, h2_parent->connection_state.mutex, this_ethread());
     h2_parent->connection_state.release_stream(this);
 
     // Current Http2ConnectionState implementation uses a memory pool for instantiating streams and DLL<> stream_list for storing

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].