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 2017/03/27 03:46:07 UTC

[trafficserver] branch 7.1.x updated (d07dbec -> 369db08)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.

      from  d07dbec   Fix a wrong option charactar for access_key
       new  f8b51e5   reconstruct to load the default value for member variables
       new  369db08   Insure that parent health stats are updated properly on a markdown when the retry window has elapsed.  This avoids premature markdowns.

The 2 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/ControlMatcher.cc       |  2 +-
 proxy/ParentConsistentHash.cc | 14 ++++++++++++--
 proxy/ParentRoundRobin.cc     | 14 ++++++++++++--
 3 files changed, 25 insertions(+), 5 deletions(-)

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

[trafficserver] 02/02: Insure that parent health stats are updated properly on a markdown when the retry window has elapsed. This avoids premature markdowns.

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 369db089b047bd0d3b044db37e96e127245efb4c
Author: jrushf1239k <Jo...@cable.comcast.com>
AuthorDate: Tue Mar 7 18:01:25 2017 +0000

    Insure that parent health stats are updated properly on a markdown
    when the retry window has elapsed.  This avoids premature markdowns.
    
    (cherry picked from commit 1aed2942411fa98047095cf93a18e0618e84bcd4)
---
 proxy/ParentConsistentHash.cc | 14 ++++++++++++--
 proxy/ParentRoundRobin.cc     | 14 ++++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/proxy/ParentConsistentHash.cc b/proxy/ParentConsistentHash.cc
index 8eedfe1..4d82601 100644
--- a/proxy/ParentConsistentHash.cc
+++ b/proxy/ParentConsistentHash.cc
@@ -279,7 +279,7 @@ ParentConsistentHash::markParentDown(const ParentSelectionPolicy *policy, Parent
     //   it relates to how long the parent has been down.
     now = time(nullptr);
 
-    // Mark the parent as down
+    // Mark the parent failure time.
     ink_atomic_swap(&pRec->failedAt, now);
 
     // If this is clean mark down and not a failed retry, we
@@ -291,7 +291,17 @@ ParentConsistentHash::markParentDown(const ParentSelectionPolicy *policy, Parent
     Note("Parent %s marked as down %s:%d", (result->retry) ? "retry" : "initially", pRec->hostname, pRec->port);
 
   } else {
-    int old_count = ink_atomic_increment(&pRec->failCount, 1);
+    int old_count = 0;
+    now           = time(NULL);
+
+    // if the last failure was outside the retry window, set the failcount to 1
+    // and failedAt to now.
+    if ((pRec->failedAt + policy->ParentRetryTime) < now) {
+      ink_atomic_swap(&pRec->failCount, 1);
+      ink_atomic_swap(&pRec->failedAt, now);
+    } else {
+      old_count = ink_atomic_increment(&pRec->failCount, 1);
+    }
 
     Debug("parent_select", "Parent fail count increased to %d for %s:%d", old_count + 1, pRec->hostname, pRec->port);
     new_fail_count = old_count + 1;
diff --git a/proxy/ParentRoundRobin.cc b/proxy/ParentRoundRobin.cc
index 66e5647..82b3aae 100644
--- a/proxy/ParentRoundRobin.cc
+++ b/proxy/ParentRoundRobin.cc
@@ -220,7 +220,7 @@ ParentRoundRobin::markParentDown(const ParentSelectionPolicy *policy, ParentResu
     //   it relates to how long the parent has been down.
     now = time(nullptr);
 
-    // Mark the parent as down
+    // Mark the parent failure time.
     ink_atomic_swap(&pRec->failedAt, now);
 
     // If this is clean mark down and not a failed retry, we
@@ -232,7 +232,17 @@ ParentRoundRobin::markParentDown(const ParentSelectionPolicy *policy, ParentResu
     Note("Parent %s marked as down %s:%d", (result->retry) ? "retry" : "initially", pRec->hostname, pRec->port);
 
   } else {
-    int old_count = ink_atomic_increment(&pRec->failCount, 1);
+    int old_count = 0;
+    now           = time(NULL);
+
+    // if the last failure was outside the retry window, set the failcount to 1
+    // and failedAt to now.
+    if ((pRec->failedAt + policy->ParentRetryTime) < now) {
+      ink_atomic_swap(&pRec->failCount, 1);
+      ink_atomic_swap(&pRec->failedAt, now);
+    } else {
+      old_count = ink_atomic_increment(&pRec->failCount, 1);
+    }
 
     Debug("parent_select", "Parent fail count increased to %d for %s:%d", old_count + 1, pRec->hostname, pRec->port);
     new_fail_count = old_count + 1;

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

[trafficserver] 01/02: reconstruct to load the default value for member variables

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit f8b51e521611c0f8f7189b7937332a989ebf087b
Author: Zhilin Huang <zh...@cisco.com>
AuthorDate: Mon Feb 27 17:03:00 2017 +0800

    reconstruct to load the default value for member variables
    
    (cherry picked from commit e13033aa297504ebfd0facf01dd9cbb269743179)
---
 proxy/ControlMatcher.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/ControlMatcher.cc b/proxy/ControlMatcher.cc
index dba507b..5908c5e 100644
--- a/proxy/ControlMatcher.cc
+++ b/proxy/ControlMatcher.cc
@@ -219,7 +219,7 @@ HostMatcher<Data, Result>::NewEntry(matcher_line *line_info)
   error = cur_d->Init(line_info);
   if (error) {
     // There was a problem so undo the effects this function
-    memset(cur_d, 0, sizeof(Data));
+    new (cur_d) Data(); // reconstruct
   } else {
     // Fill in the matching info
     host_lookup->NewEntry(match_data, (line_info->type == MATCH_DOMAIN) ? true : false, cur_d);

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