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

commit 9e1e3f6585b60431516ed34c4721c709fe55e73f
Author: Leif Hedstrom <[email protected]>
AuthorDate: Mon Jul 16 17:10:17 2018 -0400

    Revert "Clear server_entry in case of ERROR as well as NO_ACTIVITY_TIMEOUT"
    
    This reverts commit 29aad24249b1647dfc3e5f066d3f351f08224def.
    
    Seeing a crasher with this commit, and f1e3e4e0af, for details
    on the crasher see issue
    
       https://github.com/apache/trafficserver/issues/3837
---
 proxy/http/HttpSM.cc | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index f91dfbf..5a7d5f4 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -5506,13 +5506,16 @@ HttpSM::handle_server_setup_error(int event, void *data)
     }
   }
 
+  if (event == VC_EVENT_ERROR) {
+    t_state.cause_of_death_errno = server_session->get_netvc()->lerrno;
+  }
+
   switch (event) {
   case VC_EVENT_EOS:
     t_state.current.state = HttpTransact::CONNECTION_CLOSED;
     break;
   case VC_EVENT_ERROR:
-    t_state.current.state        = HttpTransact::CONNECTION_ERROR;
-    t_state.cause_of_death_errno = server_session->get_netvc()->lerrno;
+    t_state.current.state = HttpTransact::CONNECTION_ERROR;
     break;
   case VC_EVENT_ACTIVE_TIMEOUT:
     t_state.current.state = HttpTransact::ACTIVE_TIMEOUT;
@@ -5524,17 +5527,12 @@ HttpSM::handle_server_setup_error(int event, void *data)
     //   server failed
     // In case of TIMEOUT, the iocore sends back
     // server_entry->read_vio instead of the write_vio
+    // if (vio->op == VIO::WRITE && vio->ndone == 0) {
     if (server_entry->write_vio && server_entry->write_vio->nbytes > 0 && 
server_entry->write_vio->ndone == 0) {
       t_state.current.state = HttpTransact::CONNECTION_ERROR;
     } else {
       t_state.current.state = HttpTransact::INACTIVE_TIMEOUT;
     }
-    break;
-  default:
-    ink_release_assert(0);
-  }
-
-  if (event == VC_EVENT_INACTIVITY_TIMEOUT || event == VC_EVENT_ERROR) {
     // Clean up the vc_table entry so any events in play to the timed out 
server vio
     // don't get handled.  The connection isn't there.
     if (server_entry) {
@@ -5543,6 +5541,9 @@ HttpSM::handle_server_setup_error(int event, void *data)
       server_entry   = nullptr;
       server_session = nullptr;
     }
+    break;
+  default:
+    ink_release_assert(0);
   }
 
   // Closedown server connection and deallocate buffers

Reply via email to