You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sh...@apache.org on 2018/03/16 18:50:54 UTC

[trafficserver] branch master updated: Handle rescheduled transaction close event via tunnel.

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

shinrich 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 200a4fd  Handle rescheduled transaction close event via tunnel.
200a4fd is described below

commit 200a4fdc76427265de0339d81ecf05cab5fd7067
Author: Susan Hinrichs <sh...@apache.org>
AuthorDate: Fri Mar 16 10:12:29 2018 -0500

    Handle rescheduled transaction close event via tunnel.
    
    Addressess issue #3143.
---
 proxy/http/HttpSM.cc | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index b32ddc0..8d53c83 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1340,8 +1340,13 @@ HttpSM::state_api_callout(int event, void *data)
   }
 
   switch (event) {
+  case HTTP_TUNNEL_EVENT_DONE:
+  // This is a reschedule via the tunnel.  Just fall through
+  //
   case EVENT_INTERVAL:
-    ink_assert(pending_action == data);
+    if (data != pending_action) {
+      pending_action->cancel();
+    }
     pending_action = nullptr;
   // FALLTHROUGH
   case EVENT_NONE:
@@ -1506,12 +1511,6 @@ plugins required to work with sni_routing.
     }
     break;
 
-  // We may receive an event from the tunnel
-  // if it took a long time to call the SEND_RESPONSE_HDR hook
-  case HTTP_TUNNEL_EVENT_DONE:
-    state_common_wait_for_transform_read(&transform_info, &HttpSM::tunnel_handler, event, data);
-    return 0;
-
   default:
     ink_assert(false);
     terminate_sm = true;
@@ -2357,6 +2356,9 @@ HttpSM::state_cache_open_write(int event, void *data)
 
   // Make sure we are on the "right" thread
   if (ua_txn) {
+    if (pending_action) {
+      pending_action->cancel();
+    }
     if ((pending_action = ua_txn->adjust_thread(this, event, data))) {
       return 0; // Go away if we reschedule
     }
@@ -2829,7 +2831,6 @@ HttpSM::tunnel_handler(int event, void *data)
   STATE_ENTER(&HttpSM::tunnel_handler, event);
 
   ink_assert(event == HTTP_TUNNEL_EVENT_DONE);
-  ink_assert(data == &tunnel);
   // The tunnel calls this when it is done
   terminate_sm = true;
 
@@ -6783,6 +6784,8 @@ HttpSM::kill_this()
     if (callout_state == HTTP_API_NO_CALLOUT && pending_action) {
       pending_action->cancel();
       pending_action = nullptr;
+    } else if (pending_action) {
+      ink_assert(pending_action == nullptr);
     }
 
     cache_sm.end_both();
@@ -6842,6 +6845,7 @@ HttpSM::kill_this()
   //   then the value of kill_this_async_done has changed so
   //   we must check it again
   if (kill_this_async_done == true) {
+    ink_assert(pending_action == nullptr);
     if (t_state.http_config_param->enable_http_stats) {
       update_stats();
     }
@@ -7499,6 +7503,7 @@ HttpSM::set_next_state()
     Action *action_handle = statPagesManager.handle_http(this, &t_state.hdr_info.client_request);
 
     if (action_handle != ACTION_RESULT_DONE) {
+      ink_assert(pending_action == nullptr);
       pending_action = action_handle;
     }
 

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