This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch 6.2.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/6.2.x by this push:
new b5a6428 TS-4391: Duplicated parent origin retry types
b5a6428 is described below
commit b5a6428c60941a2f98af681299ad9831792dcff3
Author: jrushf1239k <[email protected]>
AuthorDate: Fri Aug 19 21:10:51 2016 +0000
TS-4391: Duplicated parent origin retry types
(cherry picked from commit 6d4637ce33ab5375cb03c06899f7ab15eb293e7e)
conflicts were properly resolved.
Conflicts:
proxy/http/HttpTransact.cc
---
proxy/http/HttpTransact.cc | 36 ++++++++++++++++++------------------
proxy/http/HttpTransact.h | 10 ++--------
2 files changed, 20 insertions(+), 26 deletions(-)
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 62954c6..ba5dbfe 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -77,30 +77,30 @@ simple_or_unavailable_server_retry(HttpTransact::State *s)
server_response, s->current.simple_retry_attempts,
s->parent_params->numParents(&s->parent_result));
// simple retry is enabled, 0x1
- if ((s->parent_result.retry_type() &
HttpTransact::PARENT_ORIGIN_SIMPLE_RETRY) &&
+ if ((s->parent_result.retry_type() & PARENT_RETRY_SIMPLE) &&
s->current.simple_retry_attempts <
s->parent_result.max_retries(PARENT_RETRY_SIMPLE) &&
server_response == HTTP_STATUS_NOT_FOUND) {
DebugTxn("parent_select", "RECEIVED A SIMPLE RETRY RESPONSE");
if (s->current.simple_retry_attempts <
s->parent_params->numParents(&s->parent_result)) {
s->current.state = HttpTransact::PARENT_ORIGIN_RETRY;
- s->current.retry_type = HttpTransact::PARENT_ORIGIN_SIMPLE_RETRY;
+ s->current.retry_type = PARENT_RETRY_SIMPLE;
return;
} else {
- DebugTxn("http_trans", "PARENT_ORIGIN_SIMPLE_RETRY: retried all parents,
send response to client.\n");
+ DebugTxn("http_trans", "PARENT_RETRY_SIMPLE: retried all parents, send
response to client.");
return;
}
}
// unavailable server retry is enabled 0x2
- else if ((s->parent_result.retry_type() &
HttpTransact::PARENT_ORIGIN_UNAVAILABLE_SERVER_RETRY) &&
+ else if ((s->parent_result.retry_type() & PARENT_RETRY_UNAVAILABLE_SERVER) &&
s->current.unavailable_server_retry_attempts <
s->parent_result.max_retries(PARENT_RETRY_UNAVAILABLE_SERVER) &&
s->parent_result.response_is_retryable(server_response)) {
- DebugTxn("parent_select", "RECEIVED A
PARENT_ORIGIN_UNAVAILABLE_SERVER_RETRY RESPONSE");
+ DebugTxn("parent_select", "RECEIVED A PARENT_RETRY_UNAVAILABLE_SERVER
RESPONSE");
if (s->current.unavailable_server_retry_attempts <
s->parent_params->numParents(&s->parent_result)) {
s->current.state = HttpTransact::PARENT_ORIGIN_RETRY;
- s->current.retry_type =
HttpTransact::PARENT_ORIGIN_UNAVAILABLE_SERVER_RETRY;
+ s->current.retry_type = PARENT_RETRY_UNAVAILABLE_SERVER;
return;
} else {
- DebugTxn("http_trans", "PARENT_ORIGIN_UNAVAILABLE_SERVER_RETRY: retried
all parents, send error to client.\n");
+ DebugTxn("http_trans", "PARENT_RETRY_UNAVAILABLE_SERVER: retried all
parents, send error to client.");
return;
}
}
@@ -3552,7 +3552,7 @@ HttpTransact::handle_response_from_parent(State *s)
if (is_response_valid(s, &s->hdr_info.server_response) &&
s->current.request_to == HttpTransact::PARENT_PROXY &&
!s->parent_result.parent_is_proxy()) {
// check for a retryable response if simple or unavailable server retry
are enabled.
- if (s->parent_result.retry_type() & (PARENT_ORIGIN_SIMPLE_RETRY |
PARENT_ORIGIN_UNAVAILABLE_SERVER_RETRY)) {
+ if (s->parent_result.retry_type() & (PARENT_RETRY_SIMPLE |
PARENT_RETRY_UNAVAILABLE_SERVER)) {
simple_or_unavailable_server_retry(s);
}
}
@@ -3590,25 +3590,25 @@ HttpTransact::handle_response_from_parent(State *s)
}
// try a simple retry if we received a simple retryable response from the
parent.
- if (s->current.retry_type == PARENT_ORIGIN_SIMPLE_RETRY ||
s->current.retry_type == PARENT_ORIGIN_UNAVAILABLE_SERVER_RETRY) {
- if (s->current.retry_type == PARENT_ORIGIN_SIMPLE_RETRY) {
+ if (s->current.retry_type == PARENT_RETRY_SIMPLE || s->current.retry_type
== PARENT_RETRY_UNAVAILABLE_SERVER) {
+ if (s->current.retry_type == PARENT_RETRY_SIMPLE) {
if (s->current.simple_retry_attempts >=
s->parent_result.max_retries(PARENT_RETRY_SIMPLE)) {
- DebugTxn("http_trans", "PARENT_ORIGIN_SIMPLE_RETRY: retried all
parents, send error to client.\n");
- s->current.retry_type = PARENT_ORIGIN_UNDEFINED_RETRY;
+ DebugTxn("http_trans", "PARENT_RETRY_SIMPLE: retried all parents,
send error to client.");
+ s->current.retry_type = PARENT_RETRY_NONE;
} else {
s->current.simple_retry_attempts++;
- DebugTxn("http_trans", "PARENT_ORIGIN_SIMPLE_RETRY: try another
parent.\n");
- s->current.retry_type = PARENT_ORIGIN_UNDEFINED_RETRY;
+ DebugTxn("http_trans", "PARENT_RETRY_SIMPLE: try another parent.");
+ s->current.retry_type = PARENT_RETRY_NONE;
next_lookup = find_server_and_update_current_info(s);
}
} else { // try unavailable server retry if we have a unavailable server
retry response from the parent.
if (s->current.unavailable_server_retry_attempts >=
s->parent_result.max_retries(PARENT_RETRY_UNAVAILABLE_SERVER)) {
- DebugTxn("http_trans", "PARENT_ORIGIN_UNAVAILABLE_SERVER_RETRY:
retried all parents, send error to client.\n");
- s->current.retry_type = PARENT_ORIGIN_UNDEFINED_RETRY;
+ DebugTxn("http_trans", "PARENT_RETRY_UNAVAILABLE_SERVER: retried all
parents, send error to client.");
+ s->current.retry_type = PARENT_RETRY_NONE;
} else {
s->current.unavailable_server_retry_attempts++;
- DebugTxn("http_trans", "PARENT_ORIGIN_UNAVAILABLE_SERVER_RETRY:
marking parent down and trying another.\n");
- s->current.retry_type = PARENT_ORIGIN_UNDEFINED_RETRY;
+ DebugTxn("http_trans", "PARENT_RETRY_UNAVAILABLE_SERVER: marking
parent down and trying another.");
+ s->current.retry_type = PARENT_RETRY_NONE;
s->parent_params->markParentDown(&s->parent_result);
next_lookup = find_server_and_update_current_info(s);
}
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index 858426b..204f3d7 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -352,12 +352,6 @@ public:
HTTP_TRANSACT_MAGIC_SEPARATOR = 0x12345678
};
- enum ParentOriginRetry_t {
- PARENT_ORIGIN_UNDEFINED_RETRY = 0x0,
- PARENT_ORIGIN_SIMPLE_RETRY = 0x1,
- PARENT_ORIGIN_UNAVAILABLE_SERVER_RETRY = 0x2
- };
-
enum LookingUp_t {
ORIGIN_SERVER,
UNDEFINED_LOOKUP,
@@ -720,7 +714,7 @@ public:
unsigned attempts;
unsigned simple_retry_attempts;
unsigned unavailable_server_retry_attempts;
- ParentOriginRetry_t retry_type;
+ ParentRetry_t retry_type;
_CurrentInfo()
: mode(UNDEFINED_MODE),
@@ -731,7 +725,7 @@ public:
attempts(1),
simple_retry_attempts(0),
unavailable_server_retry_attempts(0),
- retry_type(PARENT_ORIGIN_UNDEFINED_RETRY){};
+ retry_type(PARENT_RETRY_NONE){};
} CurrentInfo;
typedef struct _DNSLookupInfo {
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].