You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2017/10/30 15:30:45 UTC

[trafficserver] branch master updated: Prevent releasing streams simultaneously

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

maskit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 495be0e  Prevent releasing streams simultaneously
495be0e is described below

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

    Prevent releasing streams simultaneously
---
 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 6acd49a..94b7b0b 100644
--- a/proxy/http2/Http2ClientSession.cc
+++ b/proxy/http2/Http2ClientSession.cc
@@ -272,7 +272,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 c5aeac1..23eff85 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -667,6 +667,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>'].