trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shinr...@apache.org
Subject [trafficserver] branch master updated: Add information about the connect failure and source port
Date Fri, 13 Jul 2018 23:19:07 GMT
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 fbb01fe  Add information about the connect failure and source port
fbb01fe is described below

commit fbb01fe88902b955edf1a98abc6a52b3376cbe95
Author: Susan Hinrichs <shinrich@apache.org>
AuthorDate: Thu Jul 12 15:01:58 2018 -0500

    Add information about the connect failure and source port
    
    Source port info very helpful to cross reference to network activity.
---
 proxy/http/HttpSM.cc       | 6 +++++-
 proxy/http/HttpTransact.cc | 5 +++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index cc832f1..ee60b36 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1087,6 +1087,7 @@ HttpSM::state_raw_http_server_open(int event, void *data)
     server_entry->vc = netvc = (NetVConnection *)data;
     server_entry->vc_type    = HTTP_RAW_SERVER_VC;
     t_state.current.state    = HttpTransact::CONNECTION_ALIVE;
+    ats_ip_copy(&t_state.server_info.src_addr, netvc->get_local_addr());
 
     netvc->set_inactivity_timeout(HRTIME_SECONDS(t_state.txn_conf->transaction_no_activity_timeout_out));
     netvc->set_active_timeout(HRTIME_SECONDS(t_state.txn_conf->transaction_active_timeout_out));
@@ -1716,6 +1717,7 @@ HttpSM::state_http_server_open(int event, void *data)
   pending_action                              = nullptr;
   milestones[TS_MILESTONE_SERVER_CONNECT_END] = Thread::get_hrtime();
   HttpServerSession *session;
+  NetVConnection *netvc = nullptr;
 
   switch (event) {
   case NET_EVENT_OPEN:
@@ -1725,9 +1727,11 @@ HttpSM::state_http_server_open(int event, void *data)
     session->sharing_pool  = static_cast<TSServerSessionSharingPoolType>(t_state.http_config_param->server_session_sharing_pool);
     session->sharing_match = static_cast<TSServerSessionSharingMatchType>(t_state.txn_conf->server_session_sharing_match);
 
+    netvc = static_cast<NetVConnection *>(data);
     session->attach_hostname(t_state.current.server->name);
-    session->new_connection(static_cast<NetVConnection *>(data));
+    session->new_connection(netvc);
     session->state = HSS_ACTIVE;
+    ats_ip_copy(&t_state.server_info.src_addr, netvc->get_local_addr());
 
     // If origin_max_connections or origin_min_keep_alive_connections is set then we are
metering
     // the max and or min number of connections per host. Transfer responsibility for this
to the
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 24171cb..2832495 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -3608,9 +3608,10 @@ HttpTransact::retry_server_connection_not_open(State *s, ServerState_t
conn_stat
   // record the failue                   //
   //////////////////////////////////////////
   if (0 == s->current.attempts) {
-    Log::error("CONNECT:[%d] could not connect [%s] to %s for '%s'", s->current.attempts,
+    Log::error("CONNECT:[%d] could not connect [%s] to %s for '%s' connect_result=%d src_port=%d",
s->current.attempts,
                HttpDebugNames::get_server_state_name(conn_state),
-               ats_ip_ntop(&s->current.server->dst_addr.sa, addrbuf, sizeof(addrbuf)),
url_string ? url_string : "<none>");
+               ats_ip_ntop(&s->current.server->dst_addr.sa, addrbuf, sizeof(addrbuf)),
url_string ? url_string : "<none>",
+               s->current.server->connect_result, ntohs(s->current.server->src_addr.port()));
   }
 
   if (url_string) {


Mime
View raw message