You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/07/09 18:56:13 UTC

git commit: TS-1990: fix core at CacheContinuation::handleDisposeEvent()

Updated Branches:
  refs/heads/master b37a4ab26 -> 7f202436a


TS-1990: fix core at CacheContinuation::handleDisposeEvent()

I have found the root cause that cc->tunnel->vioSource->reenable_re()
may free the tunnel in some case.


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

Branch: refs/heads/master
Commit: 7f202436a54f529199d769350525eba151043233
Parents: b37a4ab
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Tue Jul 9 10:52:38 2013 -0600
Committer: James Peach <jp...@apache.org>
Committed: Tue Jul 9 10:52:38 2013 -0600

----------------------------------------------------------------------
 CHANGES                        |  2 ++
 iocore/cluster/ClusterCache.cc | 11 ++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7f202436/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9b8f281..8dde2ef 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 Changes with Apache Traffic Server 3.3.5
 
 
+  *) [TS-1990] Fix core at CacheContinuation::handleDisposeEvent().
+
   *) [TS-2010] Build fixes for OS X 10.9 and Xcode 5.
 
   *) [TS-1957] fix If CacheContinuation timeout, timeout Event will be loop

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7f202436/iocore/cluster/ClusterCache.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterCache.cc b/iocore/cluster/ClusterCache.cc
index 09865ac..2d6f011 100644
--- a/iocore/cluster/ClusterCache.cc
+++ b/iocore/cluster/ClusterCache.cc
@@ -1950,10 +1950,15 @@ CacheContinuation::handleDisposeEvent(int event, CacheContinuation * cc)
 
       cc->tunnel->vioSource->nbytes = getObjectSize(cc->tunnel->vioSource->vc_server, cc->request_opcode, 0);
       cc->tunnel->vioSource->reenable_re();
-      cc->tunnel->vioTarget->reenable();
 
-      // Tell tunnel event we are gone
-      cc->tunnel_cont->action.continuation = 0;
+      // Tunnel may be closed by vioSource->reenable_re(),
+      // we should check it again here:
+      if (!cc->tunnel_closed) {
+        cc->tunnel->vioTarget->reenable();
+
+        // Tell tunnel event we are gone
+        cc->tunnel_cont->action.continuation = 0;
+      }
     }
     cacheContAllocator_free(cc);
     return EVENT_DONE;