You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ja...@apache.org on 2015/02/25 03:16:41 UTC

[1/4] trafficserver git commit: Add tests for keepalive in

Repository: trafficserver
Updated Branches:
  refs/heads/master ef9bd671b -> 7f1e8b3fd


Add tests for keepalive in


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

Branch: refs/heads/master
Commit: 5ce2b6f651d031a454a153983afd9b280aab7b5c
Parents: 2f0440f
Author: Thomas Jackson <ja...@apache.org>
Authored: Thu Feb 19 15:00:41 2015 -0800
Committer: Thomas Jackson <ja...@apache.org>
Committed: Thu Feb 19 15:00:41 2015 -0800

----------------------------------------------------------------------
 ci/new_tsqa/tests/test_keepalive.py | 76 ++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5ce2b6f6/ci/new_tsqa/tests/test_keepalive.py
----------------------------------------------------------------------
diff --git a/ci/new_tsqa/tests/test_keepalive.py b/ci/new_tsqa/tests/test_keepalive.py
index fc49338..7e598bd 100644
--- a/ci/new_tsqa/tests/test_keepalive.py
+++ b/ci/new_tsqa/tests/test_keepalive.py
@@ -18,6 +18,7 @@ import os
 import requests
 import time
 import logging
+import socket
 
 import helpers
 
@@ -54,6 +55,81 @@ class KeepaliveTCPHandler(SocketServer.BaseRequestHandler):
                     '{body}'.format(content_length=len(body), body=body))
             self.request.sendall(resp)
 
+
+class TestKeepAliveInHTTP(tsqa.test_cases.DynamicHTTPEndpointCase, helpers.EnvironmentCase):
+    @classmethod
+    def setUpEnv(cls, env):
+
+        def hello(request):
+            return 'hello'
+        cls.http_endpoint.add_handler('/exists/', hello)
+
+        cls.configs['remap.config'].add_line('map /exists/ http://127.0.0.1:{0}/exists/'.format(cls.http_endpoint.address[1]))
+
+        # only add server headers when there weren't any
+        cls.configs['records.config']['CONFIG']['proxy.config.http.response_server_enabled'] = 2
+        cls.configs['records.config']['CONFIG']['proxy.config.http.keep_alive_enabled_in'] = 1
+        cls.configs['records.config']['CONFIG']['share_server_session'] = 2
+
+        # set only one ET_NET thread (so we don't have to worry about the per-thread pools causing issues)
+        cls.configs['records.config']['CONFIG']['proxy.config.exec_thread.limit'] = 1
+        cls.configs['records.config']['CONFIG']['proxy.config.exec_thread.autoconfig'] = 0
+
+    def _get_socket(self):
+        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        s.connect(('127.0.0.1', int(self.configs['records.config']['CONFIG']['proxy.config.http.server_ports'])))
+        return s
+
+    def test_working_path(self):
+        # connect tcp
+        s = self._get_socket()
+
+        request = ('GET /exists/ HTTP/1.1\r\n'
+                   'Host: foobar.com\r\n'
+                   '\r\n')
+        for x in xrange(1, 10):
+            s.send(request)
+            response = s.recv(4096)
+            # cheat, since we know what the body should have
+            if not response.endswith('hello'):
+                response += s.recv(4096)
+            self.assertIn('HTTP/1.1 200 OK', response)
+            self.assertIn('hello', response)
+
+    def test_error_path(self):
+        # connect tcp
+        s = self._get_socket()
+
+        request = ('GET / HTTP/1.1\r\n'
+                   'Host: foobar.com\r\n'
+                   '\r\n')
+        for x in xrange(1, 10):
+            s.send(request)
+            response = s.recv(4096)
+            self.assertIn('HTTP/1.1 404 Not Found on Accelerator', response)
+
+    def test_error_path_post(self):
+        '''
+        Ensure that sending a request with a body doesn't break the keepalive session
+        '''
+        # connect tcp
+        s = self._get_socket()
+
+        request = ('POST / HTTP/1.1\r\n'
+                   'Host: foobar.com\r\n'
+                   'Content-Length: 10\r\n'
+                   '\r\n'
+                   '1234567890')
+        for x in xrange(1, 10):
+            try:
+                s.send(request)
+            except IOError:
+                s = self._get_socket()
+                s.send(request)
+
+            response = s.recv(4096)
+            self.assertIn('HTTP/1.1 404 Not Found on Accelerator', response)
+
 # TODO: test timeouts
 # https://issues.apache.org/jira/browse/TS-3312
 # https://issues.apache.org/jira/browse/TS-242


[3/4] trafficserver git commit: TS-3404: PluginVC not notifying ActiveSide of EOS due to race condition in handling terminating chunk.

Posted by ja...@apache.org.
TS-3404: PluginVC not notifying ActiveSide of EOS due to race condition in handling terminating chunk.


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

Branch: refs/heads/master
Commit: 34f7f296cdea1ac2c15fd30577c6b85cb381e20b
Parents: 1cd91cd
Author: Thomas Jackson <ja...@apache.org>
Authored: Tue Feb 24 18:15:14 2015 -0800
Committer: Thomas Jackson <ja...@apache.org>
Committed: Tue Feb 24 18:15:14 2015 -0800

----------------------------------------------------------------------
 proxy/http/HttpSM.cc | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/34f7f296/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 6ea1b96..a544246 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -3230,11 +3230,20 @@ HttpSM::tunnel_handler_ua(int event, HttpTunnelConsumer * c)
   if (close_connection) {
     // If the client could be pipelining or is doing a POST, we need to
     //   set the ua_session into half close mode
-    if ((t_state.method == HTTP_WKSIDX_POST || t_state.client_info.pipeline_possible == true)
-        && c->producer->vc_type != HT_STATIC
-        && event == VC_EVENT_WRITE_COMPLETE) {
-      ua_session->set_half_close_flag();
-    }
+
+         // only external POSTs should be subject to this logic; ruling out internal POSTs here
+         bool is_eligible_post_request = (t_state.method == HTTP_WKSIDX_POST);
+         if (is_eligible_post_request) {
+          NetVConnection *vc = ua_session->get_netvc();
+          if (vc) {
+                 is_eligible_post_request = vc->get_is_internal_request() ? false : true;
+          }
+         }
+         if ((is_eligible_post_request || t_state.client_info.pipeline_possible == true) &&
+                          c->producer->vc_type != HT_STATIC &&
+                         event == VC_EVENT_WRITE_COMPLETE) {
+                 ua_session->set_half_close_flag();
+         }
 
     ua_session->do_io_close();
     ua_session = NULL;


[2/4] trafficserver git commit: Merge branch 'master' of github.com:apache/trafficserver

Posted by ja...@apache.org.
Merge branch 'master' of github.com:apache/trafficserver


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

Branch: refs/heads/master
Commit: 1cd91cd7b441e6e74f910c2fd66eba59c2712d47
Parents: 5ce2b6f ef9bd67
Author: Thomas Jackson <ja...@apache.org>
Authored: Tue Feb 24 18:10:38 2015 -0800
Committer: Thomas Jackson <ja...@apache.org>
Committed: Tue Feb 24 18:10:38 2015 -0800

----------------------------------------------------------------------
 .gitignore                                      |    1 +
 CHANGES                                         |   39 +-
 build/common.m4                                 |   22 +
 cmd/Makefile.am                                 |    5 +-
 cmd/traffic_ctl/Makefile.am                     |   40 +
 cmd/traffic_ctl/alarm.cc                        |  137 +++
 cmd/traffic_ctl/config.cc                       |  216 ++++
 cmd/traffic_ctl/metric.cc                       |  142 +++
 cmd/traffic_ctl/server.cc                       |  174 +++
 cmd/traffic_ctl/storage.cc                      |   56 +
 cmd/traffic_ctl/traffic_ctl.cc                  |  233 ++++
 cmd/traffic_ctl/traffic_ctl.h                   |  201 ++++
 cmd/traffic_line/traffic_line.cc                |    5 +-
 configure.ac                                    |   64 +-
 .../configuration/records.config.en.rst         |   26 +
 doc/reference/plugins/header_rewrite.en.rst     |    2 +
 iocore/cache/Cache.cc                           |    2 +-
 iocore/eventsystem/I_Lock.h                     |   74 +-
 iocore/eventsystem/Lock.cc                      |   56 +-
 iocore/hostdb/I_HostDBProcessor.h               |   21 +-
 iocore/net/Net.cc                               |    5 +
 iocore/net/P_Net.h                              |    1 +
 iocore/net/UnixNet.cc                           |   33 +-
 lib/perl/lib/Apache/TS/AdminClient.pm           |    6 +-
 lib/records/RecHttp.cc                          |   10 +-
 lib/ts/Diags.h                                  |   12 +-
 lib/ts/Hash.h                                   |    9 +
 lib/ts/HashFNV.cc                               |   29 +-
 lib/ts/HashFNV.h                                |   35 +-
 lib/ts/apidefs.h.in                             |    1 +
 lib/ts/ink_args.cc                              |   99 +-
 lib/ts/ink_args.h                               |   11 +
 lib/ts/ink_config.h.in                          |    1 +
 lib/ts/ink_llqueue.h                            |    2 +-
 lib/ts/ink_sock.cc                              |   49 +
 lib/ts/ink_sock.h                               |    1 +
 lib/ts/llqueue.cc                               |    7 +-
 mgmt/Alarms.cc                                  |   14 +-
 mgmt/LocalManager.cc                            |   47 +-
 mgmt/MgmtDefs.h                                 |    2 +-
 mgmt/RecordsConfig.cc                           |   14 +-
 mgmt/api/CoreAPIShared.h                        |    3 +
 mgmt/api/EventControlMain.cc                    |   11 +
 mgmt/api/INKMgmtAPI.cc                          |   16 +-
 mgmt/api/NetworkMessage.cc                      |   67 ++
 mgmt/api/NetworkMessage.h                       |    3 +
 mgmt/api/NetworkUtilsRemote.cc                  |   10 +-
 mgmt/api/NetworkUtilsRemote.h                   |    3 +
 mgmt/api/TSControlMain.cc                       |  122 ++-
 mgmt/api/include/mgmtapi.h                      |    5 +-
 mgmt/cluster/ClusterCom.cc                      |    6 +-
 mgmt/utils/MgmtSocket.cc                        |   56 +
 mgmt/utils/MgmtSocket.h                         |    6 +
 mgmt/web2/WebIntrMain.cc                        |  108 +-
 plugins/cacheurl/cacheurl.cc                    |   33 +-
 plugins/experimental/escalate/escalate.cc       |   28 +-
 plugins/header_rewrite/conditions.cc            |   43 +
 plugins/header_rewrite/conditions.h             |   19 +
 plugins/header_rewrite/factory.cc               |    2 +
 proxy/Main.cc                                   |    2 +
 proxy/Makefile.am                               |    1 +
 proxy/PluginVC.cc                               |   31 +-
 proxy/PluginVC.h                                |    2 +-
 proxy/hdrs/HdrToken.cc                          |   23 +-
 proxy/hdrs/HdrToken.h                           |    6 +
 proxy/hdrs/MIME.cc                              |   10 +
 proxy/hdrs/MIME.h                               |   51 +-
 proxy/http/HttpClientSession.cc                 |   22 +-
 proxy/http/HttpClientSession.h                  |    3 +
 proxy/http/HttpProxyServerMain.cc               |    6 +-
 proxy/http/HttpTransact.cc                      |   41 +
 proxy/http/HttpTransact.h                       |    1 +
 proxy/http/Makefile.am                          |    3 +-
 proxy/http2/HPACK.cc                            |  156 +--
 proxy/http2/HPACK.h                             |   27 +-
 proxy/http2/HTTP2.cc                            |  401 ++++++-
 proxy/http2/HTTP2.h                             |  129 ++-
 proxy/http2/Http2ClientSession.cc               |   85 +-
 proxy/http2/Http2ClientSession.h                |   32 +
 proxy/http2/Http2ConnectionState.cc             | 1015 +++++++++++++++++-
 proxy/http2/Http2ConnectionState.h              |  144 ++-
 proxy/logstats.cc                               |   10 +-
 82 files changed, 3955 insertions(+), 691 deletions(-)
----------------------------------------------------------------------



[4/4] trafficserver git commit: Revert "[TS-3404]: Handle race condition in handling delayed terminating chunk"

Posted by ja...@apache.org.
Revert "[TS-3404]: Handle race condition in handling delayed terminating chunk"

This reverts commit 9786ee8d66366512ac400c34c6dfc048e32d31fb.

This fix was incorrect, a *more* correct fix is in 34f7f296cdea1ac2c15fd30577c6b85cb381e20b


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

Branch: refs/heads/master
Commit: 7f1e8b3fdfe97df063a5d4c7d2b84f1ef87eada2
Parents: 34f7f29
Author: Thomas Jackson <ja...@apache.org>
Authored: Tue Feb 24 18:16:00 2015 -0800
Committer: Thomas Jackson <ja...@apache.org>
Committed: Tue Feb 24 18:16:19 2015 -0800

----------------------------------------------------------------------
 proxy/PluginVC.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7f1e8b3f/proxy/PluginVC.cc
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index 9754430..2bed3f1 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -636,7 +636,7 @@ PluginVC::process_read_side(bool other_side_call)
   Debug("pvc", "[%u] %s: process_read_side; act_on %" PRId64"", core_obj->id, PVC_TYPE, act_on);
 
   if (act_on <= 0) {
-    if (other_side->closed || other_side->write_state.shutdown || write_state.shutdown) {
+    if (other_side->closed || other_side->write_state.shutdown) {
       read_state.vio._cont->handleEvent(VC_EVENT_EOS, &read_state.vio);
     }
     return;