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 2018/03/06 00:10:04 UTC

[trafficserver] branch 7.1.x updated: Acquire lock before calling Http2ClientSession::free() from Http2ConnectionState

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 f5d1ed6  Acquire lock before calling Http2ClientSession::free() from Http2ConnectionState
f5d1ed6 is described below

commit f5d1ed6fe1c4eaaea04e600e29272d0087930ccd
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Mon Mar 5 16:23:26 2018 +0900

    Acquire lock before calling Http2ClientSession::free() from Http2ConnectionState
    
    This is possible fix of GitHub#3176.
    
    (cherry picked from commit 38b8f45d7f7efd6c679d22aba385dc79a9075e2a)
---
 proxy/http2/Http2ConnectionState.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 22a6395..24ed35f 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -939,9 +939,12 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
   --recursion;
   if (recursion == 0 && ua_session && !ua_session->is_recursing()) {
     if (this->ua_session->ready_to_free()) {
-      this->ua_session->free();
-      // After the free, the Http2ConnectionState object is also freed.
-      // The Http2ConnectionState object is allocted within the Http2ClientSession object
+      MUTEX_TRY_LOCK(lock, this->ua_session->mutex, this_ethread());
+      if (lock.is_locked()) {
+        this->ua_session->free();
+        // After the free, the Http2ConnectionState object is also freed.
+        // The Http2ConnectionState object is allocted within the Http2ClientSession object
+      }
     }
   }
 

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.