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/26 20:58:54 UTC

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

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 0ca9ca3  Handle rescheduled transaction close event via tunnel.
0ca9ca3 is described below

commit 0ca9ca39cb0ed1460e7a9ff506c75377aaab01fe
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.
    
    (cherry picked from commit 200a4fdc76427265de0339d81ecf05cab5fd7067)
    
    Conflicts:
    	proxy/http/HttpSM.cc
---
 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 13600d1..7461e39 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1345,8 +1345,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:
@@ -1478,12 +1483,6 @@ HttpSM::state_api_callout(int event, void *data)
     }
     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;
@@ -2421,6 +2420,9 @@ HttpSM::state_cache_open_write(int event, void *data)
 
   // Make sure we are on the "right" thread
   if (ua_session) {
+    if (pending_action) {
+      pending_action->cancel();
+    }
     if ((pending_action = ua_session->adjust_thread(this, event, data))) {
       return 0; // Go away if we reschedule
     }
@@ -2880,7 +2882,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;
 
@@ -6825,6 +6826,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();
@@ -6884,6 +6887,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();
     }
@@ -7560,6 +7564,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
zwoop@apache.org.