[trafficserver] branch master updated (8d4c256 -> acb3343)

2016-04-14 Thread sudheerv
This is an automated email from the ASF dual-hosted git repository.

sudheerv pushed a change to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.

  from  8d4c256   TS-4340: fix small issue related to match typ e NONE
  adds  ca28e79   [TS-3857] Change ERROR default to not log into syslogs.
  adds  26b4b43   [TS-3857] defer the default setting for 7.0
   new  acb3343   Merge pull request #567 from sudheerv/ts-3857

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 proxy/logging/LogFile.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


[trafficserver] 01/01: Merge pull request #567 from sudheerv/ts-3857

2016-04-14 Thread sudheerv
This is an automated email from the ASF dual-hosted git repository.

sudheerv pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit acb3343a568981cb4fa9c9052d01bfbb648a9980
Merge: 8d4c256 26b4b43
Author: sudheerv 
AuthorDate: Thu Apr 14 15:06:39 2016 -0700

Merge pull request #567 from sudheerv/ts-3857

[TS-3857] Change ERROR default to not log into syslogs.

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

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" .


Re: [trafficserver] branch master updated: TS-4340: fix small issue related to match typ e NONE

2016-04-14 Thread James Peach

> On Apr 14, 2016, at 1:44 PM, bri...@apache.org wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> briang pushed a commit to branch master
> in repository https://git-dual.apache.org/repos/asf/trafficserver.git
> 
> The following commit(s) were added to refs/heads/master by this push:
>   new  8d4c256   TS-4340: fix small issue related to match typ e NONE
> 8d4c256 is described below
> 
> commit 8d4c25653bb038f70651b8675a5969e522668d43
> Author: Brian Geffon 
> AuthorDate: Thu Mar 3 15:45:41 2016 -0800
> 
>TS-4340: fix small issue related to match typ e NONE
> ---
> proxy/http/HttpConnectionCount.h | 8 
> proxy/http/HttpServerSession.cc  | 4 ++--
> 2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/proxy/http/HttpConnectionCount.h 
> b/proxy/http/HttpConnectionCount.h
> index b025e8f..eea0d1a 100644
> --- a/proxy/http/HttpConnectionCount.h
> +++ b/proxy/http/HttpConnectionCount.h
> @@ -58,6 +58,10 @@ public:
>   int
>   getCount(const IpEndpoint , const INK_MD5 _hash, 
> TSServerSessionSharingMatchType match_type)
>   {
> +if (TS_SERVER_SESSION_SHARING_MATCH_NONE == match_type) {
> +  return 0; // We can never match a node if match type is NONE
> +}
> +
> ink_mutex_acquire(&_mutex);
> int count = _hostCount.get(ConnAddr(addr, hostname_hash, match_type));
> ink_mutex_release(&_mutex);
> @@ -73,6 +77,10 @@ public:
>   incrementCount(const IpEndpoint , const INK_MD5 _hash, 
> TSServerSessionSharingMatchType match_type,
>  const int delta = 1)
>   {
> +if (TS_SERVER_SESSION_SHARING_MATCH_NONE == match_type) {
> +  return; // We can never match a node if match type is NONE.
> +}
> +
> ConnAddr caddr(addr, hostname_hash, match_type);
> ink_mutex_acquire(&_mutex);
> int count = _hostCount.get(caddr);
> diff --git a/proxy/http/HttpServerSession.cc b/proxy/http/HttpServerSession.cc
> index 763c6b8..d2f2386 100644
> --- a/proxy/http/HttpServerSession.cc
> +++ b/proxy/http/HttpServerSession.cc
> @@ -140,14 +140,14 @@ HttpServerSession::do_io_close(int alerrno)
>   // Check to see if we are limiting the number of connections
>   // per host
>   if (enable_origin_connection_limiting == true) {
> -if (connection_count->getCount(server_ip, hostname_hash, sharing_match) 
> > 0) {
> +if (connection_count->getCount(server_ip, hostname_hash, sharing_match) 
> >= 0) {

Surely a count of -1 is a bug? It should be a release_assert?

>   connection_count->incrementCount(server_ip, hostname_hash, 
> sharing_match, -1);
>   ip_port_text_buffer addrbuf;
>   Debug("http_ss", "[%" PRId64 "] connection closed, ip: %s, count: %u", 
> con_id,
> ats_ip_nptop(_ip.sa, addrbuf, sizeof(addrbuf)),
> connection_count->getCount(server_ip, hostname_hash, 
> sharing_match));
> } else {
> -  Error("[%" PRId64 "] number of connections should be greater than 
> zero: %u", con_id,
> +  Error("[%" PRId64 "] number of connections should be greater than or 
> equal to zero: %u", con_id,
> connection_count->getCount(server_ip, hostname_hash, 
> sharing_match));
> }
>   }
> 
> -- 
> To stop receiving notification emails like this one, please contact
> ['"commits@trafficserver.apache.org" '].



[trafficserver] branch master updated: TS-4340: fix small issue related to match typ e NONE

2016-04-14 Thread briang
This is an automated email from the ASF dual-hosted git repository.

briang pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
   new  8d4c256   TS-4340: fix small issue related to match typ e NONE
8d4c256 is described below

commit 8d4c25653bb038f70651b8675a5969e522668d43
Author: Brian Geffon 
AuthorDate: Thu Mar 3 15:45:41 2016 -0800

TS-4340: fix small issue related to match typ e NONE
---
 proxy/http/HttpConnectionCount.h | 8 
 proxy/http/HttpServerSession.cc  | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpConnectionCount.h b/proxy/http/HttpConnectionCount.h
index b025e8f..eea0d1a 100644
--- a/proxy/http/HttpConnectionCount.h
+++ b/proxy/http/HttpConnectionCount.h
@@ -58,6 +58,10 @@ public:
   int
   getCount(const IpEndpoint , const INK_MD5 _hash, 
TSServerSessionSharingMatchType match_type)
   {
+if (TS_SERVER_SESSION_SHARING_MATCH_NONE == match_type) {
+  return 0; // We can never match a node if match type is NONE
+}
+
 ink_mutex_acquire(&_mutex);
 int count = _hostCount.get(ConnAddr(addr, hostname_hash, match_type));
 ink_mutex_release(&_mutex);
@@ -73,6 +77,10 @@ public:
   incrementCount(const IpEndpoint , const INK_MD5 _hash, 
TSServerSessionSharingMatchType match_type,
  const int delta = 1)
   {
+if (TS_SERVER_SESSION_SHARING_MATCH_NONE == match_type) {
+  return; // We can never match a node if match type is NONE.
+}
+
 ConnAddr caddr(addr, hostname_hash, match_type);
 ink_mutex_acquire(&_mutex);
 int count = _hostCount.get(caddr);
diff --git a/proxy/http/HttpServerSession.cc b/proxy/http/HttpServerSession.cc
index 763c6b8..d2f2386 100644
--- a/proxy/http/HttpServerSession.cc
+++ b/proxy/http/HttpServerSession.cc
@@ -140,14 +140,14 @@ HttpServerSession::do_io_close(int alerrno)
   // Check to see if we are limiting the number of connections
   // per host
   if (enable_origin_connection_limiting == true) {
-if (connection_count->getCount(server_ip, hostname_hash, sharing_match) > 
0) {
+if (connection_count->getCount(server_ip, hostname_hash, sharing_match) >= 
0) {
   connection_count->incrementCount(server_ip, hostname_hash, 
sharing_match, -1);
   ip_port_text_buffer addrbuf;
   Debug("http_ss", "[%" PRId64 "] connection closed, ip: %s, count: %u", 
con_id,
 ats_ip_nptop(_ip.sa, addrbuf, sizeof(addrbuf)),
 connection_count->getCount(server_ip, hostname_hash, 
sharing_match));
 } else {
-  Error("[%" PRId64 "] number of connections should be greater than zero: 
%u", con_id,
+  Error("[%" PRId64 "] number of connections should be greater than or 
equal to zero: %u", con_id,
 connection_count->getCount(server_ip, hostname_hash, 
sharing_match));
 }
   }

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


[trafficserver] branch master updated: Clang format for TS-4341

2016-04-14 Thread jacksontj
This is an automated email from the ASF dual-hosted git repository.

jacksontj pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
   new  1b65f76   Clang format for TS-4341
1b65f76 is described below

commit 1b65f76a903472a1b6b3dfcb713321ff6628d8b7
Author: Thomas Jackson 
AuthorDate: Thu Apr 14 13:43:02 2016 -0700

Clang format for TS-4341
---
 plugins/experimental/ts_lua/ts_lua_http_config.c |  3 +--
 proxy/http/HttpConfig.h  | 14 ++---
 proxy/http/HttpConnectionCount.h |  5 +++--
 proxy/http/HttpSM.cc | 13 +++-
 proxy/http/HttpTransact.h| 26 
 5 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/plugins/experimental/ts_lua/ts_lua_http_config.c 
b/plugins/experimental/ts_lua/ts_lua_http_config.c
index 2b89d30..ea1dc18 100644
--- a/plugins/experimental/ts_lua/ts_lua_http_config.c
+++ b/plugins/experimental/ts_lua/ts_lua_http_config.c
@@ -200,8 +200,7 @@ ts_lua_var_item ts_lua_http_config_vars[] = {
   TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_MAX_OPEN_WRITE_RETRIES),
   TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY),
   TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ATTACH_SERVER_SESSION_TO_CLIENT),
-  TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS_QUEUE),
-  TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_LAST_ENTRY),
+  TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS_QUEUE), 
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_LAST_ENTRY),
 };
 
 // Needed to make sure we have the latest list of overridable http config vars 
when compiling
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index 92ec3db..1f1f487 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -378,13 +378,13 @@ struct OverridableHttpConfigParams {
   cache_heuristic_min_lifetime(3600), cache_heuristic_max_lifetime(86400), 
cache_guaranteed_min_lifetime(0),
   cache_guaranteed_max_lifetime(31536000), cache_max_stale_age(604800), 
keep_alive_no_activity_timeout_in(115),
   keep_alive_no_activity_timeout_out(120), 
transaction_no_activity_timeout_in(30), transaction_no_activity_timeout_out(30),
-  transaction_active_timeout_out(0), origin_max_connections(0), 
origin_max_connections_queue(0), attach_server_session_to_client(0),
-  connect_attempts_max_retries(0), 
connect_attempts_max_retries_dead_server(3), connect_attempts_rr_retries(3),
-  connect_attempts_timeout(30), post_connect_attempts_timeout(1800), 
down_server_timeout(300), client_abort_threshold(10),
-  freshness_fuzz_time(240), freshness_fuzz_min_time(0), 
max_cache_open_read_retries(-1), cache_open_read_retry_time(10),
-  cache_generation_number(-1), max_cache_open_write_retries(1), 
background_fill_active_timeout(60), http_chunking_size(4096),
-  flow_high_water_mark(0), flow_low_water_mark(0), 
default_buffer_size_index(8), default_buffer_water_mark(32768),
-  slow_log_threshold(0),
+  transaction_active_timeout_out(0), origin_max_connections(0), 
origin_max_connections_queue(0),
+  attach_server_session_to_client(0), connect_attempts_max_retries(0), 
connect_attempts_max_retries_dead_server(3),
+  connect_attempts_rr_retries(3), connect_attempts_timeout(30), 
post_connect_attempts_timeout(1800), down_server_timeout(300),
+  client_abort_threshold(10), freshness_fuzz_time(240), 
freshness_fuzz_min_time(0), max_cache_open_read_retries(-1),
+  cache_open_read_retry_time(10), cache_generation_number(-1), 
max_cache_open_write_retries(1),
+  background_fill_active_timeout(60), http_chunking_size(4096), 
flow_high_water_mark(0), flow_low_water_mark(0),
+  default_buffer_size_index(8), default_buffer_water_mark(32768), 
slow_log_threshold(0),
 
   // Strings / floats must come last
   body_factory_template_base(NULL), body_factory_template_base_len(0), 
proxy_response_server_string(NULL),
diff --git a/proxy/http/HttpConnectionCount.h b/proxy/http/HttpConnectionCount.h
index d1f3656..b025e8f 100644
--- a/proxy/http/HttpConnectionCount.h
+++ b/proxy/http/HttpConnectionCount.h
@@ -193,7 +193,8 @@ protected:
   ink_mutex _mutex;
 };
 
-class ConnectionCountQueue: public ConnectionCount {
+class ConnectionCountQueue : public ConnectionCount
+{
 public:
   /**
* Static method to get the instance of the class
@@ -204,10 +205,10 @@ public:
   {
 return &_connectionCount;
   }
+
 private:
   static ConnectionCountQueue _connectionCount;
 };
 
 
-
 #endif
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index f084c63..2272053 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -4766,17 +4766,19 @@ HttpSM::do_http_server_open(bool raw)
   if (t_state.origin_request_queued || 
t_state.txn_conf->origin_max_connections_queue < 0) {
 

[trafficserver] branch master updated: TS-4341: add `proxy.config.http.origin_max_connections` to overridable configuration testing

2016-04-14 Thread jacksontj
This is an automated email from the ASF dual-hosted git repository.

jacksontj pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
   new  892c6e0   TS-4341: add `proxy.config.http.origin_max_connections` 
to overridable configuration testing
892c6e0 is described below

commit 892c6e0db1535e3932785fd34e60acd2dc63583a
Author: Thomas Jackson 
AuthorDate: Thu Apr 14 13:21:39 2016 -0700

TS-4341: add `proxy.config.http.origin_max_connections` to overridable 
configuration testing
---
 proxy/InkAPITest.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 8c2f8b6..ce77902 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -7219,7 +7219,7 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] 
= {
   "proxy.config.body_factory.template_base", 
"proxy.config.http.cache.open_write_fail_action",
   "proxy.config.http.redirection_enabled", 
"proxy.config.http.number_of_redirections",
   "proxy.config.http.cache.max_open_write_retries", 
"proxy.config.http.redirect_use_orig_cache_key",
-  "proxy.config.http.attach_server_session_to_client"};
+  "proxy.config.http.attach_server_session_to_client", 
"proxy.config.http.origin_max_connections_queue"};
 
 REGRESSION_TEST(SDK_API_OVERRIDABLE_CONFIGS)(RegressionTest *test, int /* 
atype ATS_UNUSED */, int *pstatus)
 {

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


[trafficserver] branch master updated: TS4287: fix unaavailable_parent_retry.

2016-04-14 Thread jrushford
This is an automated email from the ASF dual-hosted git repository.

jrushford pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
   new  5c21dd4   TS4287: fix unaavailable_parent_retry.
   new  b1bd5ca   Merge branch 'master' of github.com:apache/trafficserver
5c21dd4 is described below

commit 5c21dd4b322755c6e019bc268e1c3e0a8377c8b0
Author: John J. Rushford 
AuthorDate: Thu Apr 14 19:58:10 2016 +

TS4287: fix unaavailable_parent_retry.
---
 proxy/ParentSelection.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc
index 370a46e..c992d2e 100644
--- a/proxy/ParentSelection.cc
+++ b/proxy/ParentSelection.cc
@@ -659,7 +659,7 @@ ParentRecord::Init(matcher_line *line_info)
 Warning("%s disabling parent_retry on line %d because parent_is_proxy is 
true", modulePrefix, line_num);
   } else {
 // delete unavailable_server_retry_responses if unavailable_server_retry 
is not enabled.
-if (unavailable_server_retry_responses != NULL && (!parent_retry & 
PARENT_RETRY_UNAVAILABLE_SERVER)) {
+if (unavailable_server_retry_responses != NULL && !(parent_retry & 
PARENT_RETRY_UNAVAILABLE_SERVER)) {
   Warning("%s ignoring unavailable_server_retry_responses directive on 
line %d, as unavailable_server_retry is not enabled.",
   modulePrefix, line_num);
   delete unavailable_server_retry_responses;

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


[trafficserver] 01/01: Merge pull request #564 from jacksontj/TS-4341

2016-04-14 Thread jacksontj
This is an automated email from the ASF dual-hosted git repository.

jacksontj pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 972bd4d368f79f5a1b0eaadbc58632285375d68e
Merge: 764749b 600a98e
Author: Thomas Jackson 
AuthorDate: Thu Apr 14 10:52:37 2016 -0700

Merge pull request #564 from jacksontj/TS-4341

TS-4341

 ci/tsqa/tests/test_origin_max_connections.py | 213 +++
 doc/admin-guide/files/records.config.en.rst  |   9 +
 lib/ts/apidefs.h.in  |   1 +
 mgmt/RecordsConfig.cc|   2 +
 plugins/experimental/ts_lua/ts_lua_http_config.c |   5 +-
 proxy/InkAPI.cc  |   6 +
 proxy/http/HttpConfig.cc |   8 +
 proxy/http/HttpConfig.h  |   3 +-
 proxy/http/HttpConnectionCount.cc|   1 +
 proxy/http/HttpConnectionCount.h |  19 +-
 proxy/http/HttpSM.cc |  37 +++-
 proxy/http/HttpTransact.h|   5 +-
 12 files changed, 304 insertions(+), 5 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" .


[trafficserver] branch master updated (764749b -> 972bd4d)

2016-04-14 Thread jacksontj
This is an automated email from the ASF dual-hosted git repository.

jacksontj pushed a change to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.

  from  764749b   Merge pull request #569 from bgaff/TS-4340
  adds  9a14797   TS-4340: Fix origin max connections
  adds  84e29a4   TS-4340 Add tests for per-origin connection limits
  adds  38aa266   TS-4341 add `origin_max_connections_queue`
  adds  faf06b3   TS-4341 Document origin_max_connections_queue
  adds  fa1bb29   TS-4342 Add tests for queued/max connections in addition 
to base tests
  adds  600a98e   Test for queue leaking in the CLIENT_ABORT case
   new  972bd4d   Merge pull request #564 from jacksontj/TS-4341

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ci/tsqa/tests/test_origin_max_connections.py | 213 +++
 doc/admin-guide/files/records.config.en.rst  |   9 +
 lib/ts/apidefs.h.in  |   1 +
 mgmt/RecordsConfig.cc|   2 +
 plugins/experimental/ts_lua/ts_lua_http_config.c |   5 +-
 proxy/InkAPI.cc  |   6 +
 proxy/http/HttpConfig.cc |   8 +
 proxy/http/HttpConfig.h  |   3 +-
 proxy/http/HttpConnectionCount.cc|   1 +
 proxy/http/HttpConnectionCount.h |  19 +-
 proxy/http/HttpSM.cc |  37 +++-
 proxy/http/HttpTransact.h|   5 +-
 12 files changed, 304 insertions(+), 5 deletions(-)
 create mode 100644 ci/tsqa/tests/test_origin_max_connections.py

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


[trafficserver] branch master updated (a387890 -> 764749b)

2016-04-14 Thread briang
This is an automated email from the ASF dual-hosted git repository.

briang pushed a change to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.

  from  a387890   TS-4287: Add a simple and unavailable server retry 
feature to Parent Selection.
  adds  c16f20d   TS-4340: Fix origin max connections
   new  764749b   Merge pull request #569 from bgaff/TS-4340

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 lib/ts/ink_inet.cc   | 20 
 lib/ts/ink_inet.h|  2 +
 proxy/http/HttpConnectionCount.h | 98 
 proxy/http/HttpSM.cc | 14 --
 proxy/http/HttpServerSession.cc  | 19 
 proxy/http/HttpSessionManager.cc |  4 +-
 6 files changed, 135 insertions(+), 22 deletions(-)

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


[trafficserver] 01/01: Merge pull request #569 from bgaff/TS-4340

2016-04-14 Thread briang
This is an automated email from the ASF dual-hosted git repository.

briang pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 764749b38e2d9f52a42b5ad53ed204e2879987c9
Merge: a387890 c16f20d
Author: Brian Geffon 
AuthorDate: Thu Apr 14 10:50:26 2016 -0700

Merge pull request #569 from bgaff/TS-4340

TS-4340: Fix origin max connections

 lib/ts/ink_inet.cc   | 20 
 lib/ts/ink_inet.h|  2 +
 proxy/http/HttpConnectionCount.h | 98 
 proxy/http/HttpSM.cc | 14 --
 proxy/http/HttpServerSession.cc  | 19 
 proxy/http/HttpSessionManager.cc |  4 +-
 6 files changed, 135 insertions(+), 22 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" .


[trafficserver] branch master updated: TS-4287: Add a simple and unavailable server retry feature to Parent Selection.

2016-04-14 Thread jrushford
This is an automated email from the ASF dual-hosted git repository.

jrushford pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
   new  a387890   TS-4287: Add a simple and unavailable server retry 
feature to Parent Selection.
a387890 is described below

commit a387890c51fe47843b92ec07327334d3247aea53
Author: John J. Rushford 
AuthorDate: Thu Apr 14 16:11:17 2016 +

TS-4287: Add a simple and unavailable server retry feature to Parent 
Selection.
---
 doc/admin-guide/files/parent.config.en.rst | 40 +
 proxy/ParentSelection.cc   | 91 +-
 proxy/ParentSelection.h| 32 ++-
 proxy/http/HttpDebugNames.cc   |  2 +
 proxy/http/HttpTransact.cc | 77 -
 proxy/http/HttpTransact.h  | 15 -
 6 files changed, 252 insertions(+), 5 deletions(-)

diff --git a/doc/admin-guide/files/parent.config.en.rst 
b/doc/admin-guide/files/parent.config.en.rst
index a8554f8..c3df065 100644
--- a/doc/admin-guide/files/parent.config.en.rst
+++ b/doc/admin-guide/files/parent.config.en.rst
@@ -150,6 +150,46 @@ The following list shows the possible actions and their 
allowed values.
 the specified ``round_robin`` algorithm.  The FQDN is removed from
 the http request line.
 
+.. _parent-config-format-parent-retry:
+
+``parent_retry``
+  If ``parent_is_proxy`` is false, then you may configure ``parent_retry`` for 
one
+  of the following values:
+
+- ``simple_retry`` - If the parent origin server returns a 404 response on 
a request
+  a new parent is selected and the request is retried.  The number of 
retries is controlled
+  by ``max_simple_retries`` which is set to 1 by default.
+- ``unavailable_server_retry`` - If the parent returns a 503 response or 
if the reponse matches
+  a list of http 5xx responses defined in 
``unavailable_server_retry_responses``, the currently selected
+  parent is marked down and a new parent is selected to retry the request. 
 The number of
+  retries is controlled by ``max_unavailable_server_retries`` which is set 
to 1 by default.
+- ``both`` - This enables both ``simple_retry`` and 
``unavailable_server_retry`` as described above.
+
+.. _parent-config-format-unavailable-server-retry-responses:
+
+``unavailable_server_retry_responses``
+  If ``parent_is_proxy`` is false and ``parent_retry`` is set to either 
``unavailable_server_retry`` or
+  ``both``, this parameter is a comma separated list of http 5xx response 
codes that will invoke the
+  ``unavailable_server_retry`` described in the ``parent_retry`` section.  By 
default, ``unavailable_server_retry_responses``
+  is set to 503.
+
+.. _parent-config-format-max-simple-retries:
+
+``max_simple_retries``
+  By default the value for ``max_simple_retries`` is 1.  It may be set to any 
value in the range 1 to 5.
+  If ``parent_is_proxy`` is false and ``parent_retry`` is set to 
``simple_retry`` or ``both`` a 404 reponse
+  from a parent origin server will cause the request to be retried using a new 
parent at most 1 to 5
+  times as configured by ``max_simple_retries``.
+
+.. _parent-config-format-max-unavailable-server-retries:
+
+``max_unavailable_server_retries``
+  By default the value for ``max_unavailable_server_retries`` is 1.  It may be 
set to any value in the range 1 to 5.
+  If ``parent_is_proxy`` is false and ``parent_retry`` is set to 
``unavailable_server_retries`` or ``both`` a 503 reponse
+  by default or any http 5xx response listed in the list 
``unavailable_server_retry_responses`` from a parent origin server will
+  cause the request to be retried using a new parent after first marking the 
current parent down.  The request
+  will be retried at most 1 to 5 times as configured by 
``max_unavailable_server_retries``.
+
 .. _parent-config-format-round-robin:
 
 ``round_robin``
diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc
index 8fdfe58..370a46e 100644
--- a/proxy/ParentSelection.cc
+++ b/proxy/ParentSelection.cc
@@ -35,6 +35,9 @@
 #define PARENT_ReadConfigInteger REC_ReadConfigInteger
 #define PARENT_ReadConfigStringAlloc REC_ReadConfigStringAlloc
 
+#define MAX_SIMPLE_RETRIES 5
+#define MAX_UNAVAILABLE_SERVER_RETRIES 5
+
 typedef ControlMatcher P_table;
 
 // Global Vars for Parent Selection
@@ -324,6 +327,32 @@ ParentConfig::print()
   ParentConfig::release(params);
 }
 
+UnavailableServerResponseCodes::UnavailableServerResponseCodes(char *val)
+{
+  Tokenizer pTok(", \t\r");
+  int numTok = 0, c;
+
+  if (val == NULL) {
+Warning("UnavailableServerResponseCodes - 
unavailable_server_retry_responses is null loading default 503 code.");
+codes.push_back(HTTP_STATUS_SERVICE_UNAVAILABLE);
+return;
+  }
+  numTok =