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 2015/08/04 01:10:12 UTC

[1/7] trafficserver git commit: TS-3810 traffic_manager leaks that thread stack, make sure to detach the threads

Repository: trafficserver
Updated Branches:
  refs/heads/6.0.x 53f150c33 -> 6062188f5


TS-3810 traffic_manager leaks that thread stack, make sure to detach the threads


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b5c7dbb8
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b5c7dbb8
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b5c7dbb8

Branch: refs/heads/6.0.x
Commit: b5c7dbb8a9265e83742a0c56744c9fa4a298c7f0
Parents: 1d1eaa6
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jul 31 14:28:06 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jul 31 14:28:06 2015 -0600

----------------------------------------------------------------------
 cmd/traffic_manager/MgmtHandlers.cc | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b5c7dbb8/cmd/traffic_manager/MgmtHandlers.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_manager/MgmtHandlers.cc b/cmd/traffic_manager/MgmtHandlers.cc
index a7f44ce..0569d2b 100644
--- a/cmd/traffic_manager/MgmtHandlers.cc
+++ b/cmd/traffic_manager/MgmtHandlers.cc
@@ -258,6 +258,8 @@ mgmt_synthetic_main(void *)
 
       if (thrId <= 0) {
         mgmt_log(stderr, "[SyntheticHealthServer] Failed to create worker thread");
+      } else {
+        pthread_detach(thrId); // We don't care to join this sucker
       }
     }
   }


[2/7] trafficserver git commit: Revert "TS-3810 traffic_manager leaks that thread stack, make sure to detach the threads"

Posted by zw...@apache.org.
Revert "TS-3810 traffic_manager leaks that thread stack, make sure to detach the threads"

This reverts commit b5c7dbb8a9265e83742a0c56744c9fa4a298c7f0.

jpeach says to pass the detach=1 to ink_thread_create.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9180ed6c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9180ed6c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9180ed6c

Branch: refs/heads/6.0.x
Commit: 9180ed6c514b586249c21bacc33e12e84e6301fc
Parents: b5c7dbb
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jul 31 14:33:23 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jul 31 14:33:23 2015 -0600

----------------------------------------------------------------------
 cmd/traffic_manager/MgmtHandlers.cc | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9180ed6c/cmd/traffic_manager/MgmtHandlers.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_manager/MgmtHandlers.cc b/cmd/traffic_manager/MgmtHandlers.cc
index 0569d2b..a7f44ce 100644
--- a/cmd/traffic_manager/MgmtHandlers.cc
+++ b/cmd/traffic_manager/MgmtHandlers.cc
@@ -258,8 +258,6 @@ mgmt_synthetic_main(void *)
 
       if (thrId <= 0) {
         mgmt_log(stderr, "[SyntheticHealthServer] Failed to create worker thread");
-      } else {
-        pthread_detach(thrId); // We don't care to join this sucker
       }
     }
   }


[7/7] trafficserver git commit: Merge branch 'master' into 6.0.x

Posted by zw...@apache.org.
Merge branch 'master' into 6.0.x

* master:
  TS-3796: health check fails once during startup
  Revert "TS-3376: traffic_server failed assert s->current.server->had_connect_fail()"
  TS-3376: traffic_server failed assert s->current.server->had_connect_fail()
  TS-3810 traffic_manager leaks that thread stack, make sure to detach the threads
  Revert "TS-3810 traffic_manager leaks that thread stack, make sure to detach the threads"
  TS-3810 traffic_manager leaks that thread stack, make sure to detach the threads


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6062188f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6062188f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6062188f

Branch: refs/heads/6.0.x
Commit: 6062188f57efa48d6208311ff4d111d41b7cd93b
Parents: 53f150c 35c5a45
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Aug 3 17:09:55 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Aug 3 17:09:55 2015 -0600

----------------------------------------------------------------------
 cmd/traffic_manager/MgmtHandlers.cc | 12 +++++++-----
 mgmt/LocalManager.cc                |  4 ++--
 mgmt/api/EventControlMain.cc        |  2 +-
 mgmt/api/TSControlMain.cc           |  2 +-
 mgmt/cluster/ClusterCom.cc          |  2 +-
 mgmt/utils/MgmtSocket.cc            |  4 +++-
 mgmt/utils/MgmtSocket.h             |  2 +-
 7 files changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------



[4/7] trafficserver git commit: TS-3376: traffic_server failed assert s->current.server->had_connect_fail()

Posted by zw...@apache.org.
TS-3376: traffic_server failed assert s->current.server->had_connect_fail()


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/619b0390
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/619b0390
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/619b0390

Branch: refs/heads/6.0.x
Commit: 619b0390f711e77b39b82e8791655f7597abbca3
Parents: a532d6d
Author: Brian Geffon <br...@apache.org>
Authored: Sun Aug 2 20:35:30 2015 -0700
Committer: Brian Geffon <br...@apache.org>
Committed: Sun Aug 2 20:35:30 2015 -0700

----------------------------------------------------------------------
 proxy/http/HttpTransact.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/619b0390/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index b63f8bc..48cf2a0 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -3651,6 +3651,11 @@ HttpTransact::handle_response_from_server(State *s)
     break;
   case CONNECTION_CLOSED:
   /* fall through */
+    DebugTxn("http_trans",
+              "[handle_response_from_server] Transaction received a bad response or a partial response, not retrying...");
+     SET_VIA_STRING(VIA_DETAIL_SERVER_CONNECT, VIA_DETAIL_SERVER_FAILURE);
+     handle_server_connection_not_open(s);
+     break;
   case PARSE_ERROR:
   /* fall through */
   case BAD_INCOMING_RESPONSE: {
@@ -3658,7 +3663,8 @@ HttpTransact::handle_response_from_server(State *s)
     DebugTxn("http_trans",
              "[handle_response_from_server] Transaction received a bad response or a partial response, not retrying...");
     SET_VIA_STRING(VIA_DETAIL_SERVER_CONNECT, VIA_DETAIL_SERVER_FAILURE);
-    handle_server_connection_not_open(s);
+    handle_server_died(s);
+    s->next_action = SM_ACTION_SEND_ERROR_CACHE_NOOP;
     break;
   }
   case OPEN_RAW_ERROR:


[5/7] trafficserver git commit: Revert "TS-3376: traffic_server failed assert s->current.server->had_connect_fail()"

Posted by zw...@apache.org.
Revert "TS-3376: traffic_server failed assert s->current.server->had_connect_fail()"

This reverts commit 619b0390f711e77b39b82e8791655f7597abbca3.

I'm reverting this for two reasons:

1) It doesn't fix the problem.

2) It doesn't format properly with clang-format.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/7abadb72
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/7abadb72
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/7abadb72

Branch: refs/heads/6.0.x
Commit: 7abadb7242cc783a0bde21762e94316fab24d071
Parents: 619b039
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Aug 3 13:15:06 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Aug 3 13:15:06 2015 -0600

----------------------------------------------------------------------
 proxy/http/HttpTransact.cc | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7abadb72/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 48cf2a0..b63f8bc 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -3651,11 +3651,6 @@ HttpTransact::handle_response_from_server(State *s)
     break;
   case CONNECTION_CLOSED:
   /* fall through */
-    DebugTxn("http_trans",
-              "[handle_response_from_server] Transaction received a bad response or a partial response, not retrying...");
-     SET_VIA_STRING(VIA_DETAIL_SERVER_CONNECT, VIA_DETAIL_SERVER_FAILURE);
-     handle_server_connection_not_open(s);
-     break;
   case PARSE_ERROR:
   /* fall through */
   case BAD_INCOMING_RESPONSE: {
@@ -3663,8 +3658,7 @@ HttpTransact::handle_response_from_server(State *s)
     DebugTxn("http_trans",
              "[handle_response_from_server] Transaction received a bad response or a partial response, not retrying...");
     SET_VIA_STRING(VIA_DETAIL_SERVER_CONNECT, VIA_DETAIL_SERVER_FAILURE);
-    handle_server_died(s);
-    s->next_action = SM_ACTION_SEND_ERROR_CACHE_NOOP;
+    handle_server_connection_not_open(s);
     break;
   }
   case OPEN_RAW_ERROR:


[3/7] trafficserver git commit: TS-3810 traffic_manager leaks that thread stack, make sure to detach the threads

Posted by zw...@apache.org.
TS-3810 traffic_manager leaks that thread stack, make sure to detach the threads


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a532d6d9
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a532d6d9
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a532d6d9

Branch: refs/heads/6.0.x
Commit: a532d6d9de75c1802700e1e18c3f27742cc65e87
Parents: 9180ed6
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jul 31 14:35:35 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jul 31 14:35:35 2015 -0600

----------------------------------------------------------------------
 cmd/traffic_manager/MgmtHandlers.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a532d6d9/cmd/traffic_manager/MgmtHandlers.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_manager/MgmtHandlers.cc b/cmd/traffic_manager/MgmtHandlers.cc
index a7f44ce..5e974ef 100644
--- a/cmd/traffic_manager/MgmtHandlers.cc
+++ b/cmd/traffic_manager/MgmtHandlers.cc
@@ -254,7 +254,7 @@ mgmt_synthetic_main(void *)
       mgmt_log(stderr, "[SyntheticHealthServer] Connect by disallowed client %s, closing\n", inet_ntoa(clientInfo.sin_addr));
       close_socket(clientFD);
     } else {
-      ink_thread thrId = ink_thread_create(synthetic_thread, (void *)&clientFD);
+      ink_thread thrId = ink_thread_create(synthetic_thread, (void *)&clientFD, 1);
 
       if (thrId <= 0) {
         mgmt_log(stderr, "[SyntheticHealthServer] Failed to create worker thread");


[6/7] trafficserver git commit: TS-3796: health check fails once during startup

Posted by zw...@apache.org.
TS-3796: health check fails once during startup

Make sure that we initialize the socket length so that
accept(2) doesn't spuriously fail.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/35c5a457
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/35c5a457
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/35c5a457

Branch: refs/heads/6.0.x
Commit: 35c5a457c6c154be53cf5907997374ebbe5a990e
Parents: 7abadb7
Author: James Peach <jp...@apache.org>
Authored: Mon Aug 3 13:34:08 2015 -0700
Committer: James Peach <jp...@apache.org>
Committed: Mon Aug 3 13:35:46 2015 -0700

----------------------------------------------------------------------
 cmd/traffic_manager/MgmtHandlers.cc | 12 +++++++-----
 mgmt/LocalManager.cc                |  4 ++--
 mgmt/api/EventControlMain.cc        |  2 +-
 mgmt/api/TSControlMain.cc           |  2 +-
 mgmt/cluster/ClusterCom.cc          |  2 +-
 mgmt/utils/MgmtSocket.cc            |  4 +++-
 mgmt/utils/MgmtSocket.h             |  2 +-
 7 files changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/35c5a457/cmd/traffic_manager/MgmtHandlers.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_manager/MgmtHandlers.cc b/cmd/traffic_manager/MgmtHandlers.cc
index 5e974ef..913037d 100644
--- a/cmd/traffic_manager/MgmtHandlers.cc
+++ b/cmd/traffic_manager/MgmtHandlers.cc
@@ -211,11 +211,9 @@ error:
 void *
 mgmt_synthetic_main(void *)
 {
-  int autoconfFD = -1;           // FD for incoming autoconf connections
-  int clientFD = -1;             // FD for accepted connections
-  int publicPort = -1;           // Port for incoming autoconf connections
-  struct sockaddr_in clientInfo; // Info about client connection
-  int addrLen;
+  int autoconfFD = -1; // FD for incoming autoconf connections
+  int clientFD = -1;   // FD for accepted connections
+  int publicPort = -1; // Port for incoming autoconf connections
 
 #if !defined(linux)
   sigset_t allSigs; // Set of all signals
@@ -245,6 +243,10 @@ mgmt_synthetic_main(void *)
   }
 
   while (1) {
+    struct sockaddr_in clientInfo; // Info about client connection
+    socklen_t addrLen = sizeof(clientInfo);
+
+    ink_zero(clientInfo);
     if ((clientFD = mgmt_accept(autoconfFD, (sockaddr *)&clientInfo, &addrLen)) < 0) {
       mgmt_log(stderr, "[SyntheticHealthServer] accept() on incoming port failed: %s\n", strerror(errno));
     } else if (safe_setsockopt(clientFD, IPPROTO_TCP, TCP_NODELAY, SOCKOPT_ON, sizeof(int)) < 0) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/35c5a457/mgmt/LocalManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index 4630969..30f8cac 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -392,7 +392,6 @@ LocalManager::pollMgmtProcessServer()
 {
   int num;
   struct timeval timeout;
-  struct sockaddr_in clientAddr;
   fd_set fdlist;
 #if TS_HAS_WCCP
   int wccp_fd = wccp_cache.getSocket();
@@ -430,7 +429,8 @@ LocalManager::pollMgmtProcessServer()
       }
 #endif
       if (FD_ISSET(process_server_sockfd, &fdlist)) { /* New connection */
-        int clientLen = sizeof(clientAddr);
+        struct sockaddr_in clientAddr;
+        socklen_t clientLen = sizeof(clientAddr);
         int new_sockfd = mgmt_accept(process_server_sockfd, (struct sockaddr *)&clientAddr, &clientLen);
         MgmtMessageHdr *mh;
         int data_len;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/35c5a457/mgmt/api/EventControlMain.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/EventControlMain.cc b/mgmt/api/EventControlMain.cc
index c26855f..44ad69c 100644
--- a/mgmt/api/EventControlMain.cc
+++ b/mgmt/api/EventControlMain.cc
@@ -269,7 +269,6 @@ event_callback_main(void *arg)
   InkHashTableIteratorState con_state; // used to iterate through hash table
   int fds_ready;                       // return value for select go here
   struct timeval timeout;
-  int addr_len = (sizeof(struct sockaddr));
 
   while (1) {
     // LINUX fix: to prevent hard-spin reset timeout on each loop
@@ -312,6 +311,7 @@ event_callback_main(void *arg)
           // Debug ("TS_Control_Main", "can't create new EventClientT for new connection\n");
         } else {
           // accept connection
+          socklen_t addr_len = (sizeof(struct sockaddr));
           new_con_fd = mgmt_accept(con_socket_fd, new_client_con->adr, &addr_len);
           new_client_con->fd = new_con_fd;
           ink_hash_table_insert(accepted_clients, (char *)&new_client_con->fd, new_client_con);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/35c5a457/mgmt/api/TSControlMain.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/TSControlMain.cc b/mgmt/api/TSControlMain.cc
index 296b7d5..0673b29 100644
--- a/mgmt/api/TSControlMain.cc
+++ b/mgmt/api/TSControlMain.cc
@@ -139,7 +139,6 @@ ts_ctrl_main(void *arg)
   InkHashTableIteratorState con_state; // used to iterate through hash table
   int fds_ready;                       // stores return value for select
   struct timeval timeout;
-  int addr_len = (sizeof(struct sockaddr));
 
   // loops until TM dies; waits for and processes requests from clients
   while (1) {
@@ -181,6 +180,7 @@ ts_ctrl_main(void *arg)
           // return TS_ERR_SYS_CALL; WHAT TO DO? just keep going
           Debug("ts_main", "[ts_ctrl_main] can't allocate new ClientT\n");
         } else { // accept connection
+          socklen_t addr_len = (sizeof(struct sockaddr));
           new_con_fd = mgmt_accept(con_socket_fd, new_client_con->adr, &addr_len);
           new_client_con->fd = new_con_fd;
           ink_hash_table_insert(accepted_con, (char *)&new_client_con->fd, new_client_con);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/35c5a457/mgmt/cluster/ClusterCom.cc
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.cc b/mgmt/cluster/ClusterCom.cc
index 45055ff..0c8d2ca 100644
--- a/mgmt/cluster/ClusterCom.cc
+++ b/mgmt/cluster/ClusterCom.cc
@@ -167,7 +167,7 @@ drainIncomingChannel(void *arg)
 
     if (mgmt_read_timeout(ccom->reliable_server_fd, ccom->mc_poll_timeout /* secs */, 0 /* usecs */) > 0) {
       /* Reliable(TCP) request */
-      int clilen = sizeof(cli_addr);
+      socklen_t clilen = sizeof(cli_addr);
       int req_fd = mgmt_accept(ccom->reliable_server_fd, (struct sockaddr *)&cli_addr, &clilen);
       if (req_fd < 0) {
         mgmt_elog(stderr, errno, "[drainIncomingChannel] error accepting "

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/35c5a457/mgmt/utils/MgmtSocket.cc
----------------------------------------------------------------------
diff --git a/mgmt/utils/MgmtSocket.cc b/mgmt/utils/MgmtSocket.cc
index bab4e90..65ae0f4 100644
--- a/mgmt/utils/MgmtSocket.cc
+++ b/mgmt/utils/MgmtSocket.cc
@@ -22,6 +22,7 @@
  */
 
 #include "ts/ink_platform.h"
+#include "ts/ink_assert.h"
 #include "MgmtSocket.h"
 
 #if HAVE_UCRED_H
@@ -61,9 +62,10 @@ mgmt_transient_error()
 //-------------------------------------------------------------------------
 
 int
-mgmt_accept(int s, struct sockaddr *addr, int *addrlen)
+mgmt_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
 {
   int r, retries;
+  ink_assert(*addrlen != 0);
   for (retries = 0; retries < MGMT_MAX_TRANSIENT_ERRORS; retries++) {
     r = ::accept(s, addr, (socklen_t *)addrlen);
     if (r >= 0)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/35c5a457/mgmt/utils/MgmtSocket.h
----------------------------------------------------------------------
diff --git a/mgmt/utils/MgmtSocket.h b/mgmt/utils/MgmtSocket.h
index a48228a..eaac8be 100644
--- a/mgmt/utils/MgmtSocket.h
+++ b/mgmt/utils/MgmtSocket.h
@@ -46,7 +46,7 @@ bool mgmt_transient_error();
 // mgmt_accept
 //-------------------------------------------------------------------------
 
-int mgmt_accept(int s, struct sockaddr *addr, int *addrlen);
+int mgmt_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
 
 //-------------------------------------------------------------------------
 // mgmt_fopen