trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] branch 7.1.x updated: Cleanup server_entry before do dns lookup
Date Mon, 05 Jun 2017 15:06:14 GMT
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 cb9076f  Cleanup server_entry before do dns lookup
cb9076f is described below

commit cb9076f5ed85d58c72d0d63954f1e559d4bfc662
Author: Oknet Xu <xuchao@skyguard.com.cn>
AuthorDate: Thu Jun 1 13:37:02 2017 +0800

    Cleanup server_entry before do dns lookup
    
    ATS has server connection retry mechanism. It tries to connect
    server ip first then other ip by DNS round robin.
    
    Currently, ATS will do cleanup server_entry before retry to connect
    server ip. But it does not cleanup server_entry before do dns lookup.
    
    (cherry picked from commit 89403ff6aabadef26511712841cf0c82517ffb4b)
---
 proxy/http/HttpSM.cc | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index de96aa9..8cc2318 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -7358,6 +7358,32 @@ HttpSM::set_next_state()
 
     HTTP_SM_SET_DEFAULT_HANDLER(&HttpSM::state_hostdb_lookup);
 
+    // We need to close the previous attempt
+    // Because it could be a server side retry by DNS rr
+    if (server_entry) {
+      ink_assert(server_entry->vc_type == HTTP_SERVER_VC);
+      vc_table.cleanup_entry(server_entry);
+      server_entry   = nullptr;
+      server_session = nullptr;
+    } else {
+      // Now that we have gotten the user agent request, we can cancel
+      // the inactivity timeout associated with it.  Note, however, that
+      // we must not cancel the inactivity timeout if the message
+      // contains a body (as indicated by the non-zero request_content_length
+      // field).  This indicates that a POST operation is taking place and
+      // that the client is still sending data to the origin server.  The
+      // origin server cannot reply until the entire request is received.  In
+      // light of this dependency, TS must ensure that the client finishes
+      // sending its request and for this reason, the inactivity timeout
+      // cannot be cancelled.
+      if (ua_session && !t_state.hdr_info.request_content_length) {
+        ua_session->cancel_inactivity_timeout();
+      } else if (!ua_session) {
+        terminate_sm = true;
+        return; // Give up if there is no session
+      }
+    }
+
     ink_assert(t_state.dns_info.looking_up != HttpTransact::UNDEFINED_LOOKUP);
     do_hostdb_lookup();
     break;

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message