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 2021/02/04 21:50:12 UTC

[trafficserver] branch 9.0.x updated: Fix issue with unavailable server retry codes (#7410)

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 5d111be  Fix issue with unavailable server retry codes (#7410)
5d111be is described below

commit 5d111bea2ce2ff866135eff2e8b6fdf911ad96d3
Author: Evan Zelkowitz <ez...@apache.org>
AuthorDate: Mon Jan 11 10:23:10 2021 -0700

    Fix issue with unavailable server retry codes (#7410)
    
    Currently when populating the list it checks for >500, this should be 499 to not exclude `500`
    
    Also adding warnings during token parsing to notify if a user has added an erroneous err code to the unavailable or simple codes list
    
    (cherry picked from commit 98ec28e64cb93cb40e6cd845da3022bdd68d6148)
---
 proxy/ParentSelection.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc
index 1b6a861..625db90 100644
--- a/proxy/ParentSelection.cc
+++ b/proxy/ParentSelection.cc
@@ -336,15 +336,17 @@ UnavailableServerResponseCodes::UnavailableServerResponseCodes(char *val)
   numTok = pTok.Initialize(val, SHARE_TOKS);
   if (numTok == 0) {
     c = atoi(val);
-    if (c > 500 && c < 600) {
+    if (c > 499 && c < 600) {
       codes.push_back(HTTP_STATUS_SERVICE_UNAVAILABLE);
     }
   }
   for (int i = 0; i < numTok; i++) {
     c = atoi(pTok[i]);
-    if (c > 500 && c < 600) {
+    if (c > 499 && c < 600) {
       Debug("parent_select", "loading response code: %d", c);
       codes.push_back(c);
+    } else {
+      Warning("UnavailableServerResponseCodes received non-5xx code '%s', ignoring!", pTok[i]);
     }
   }
   std::sort(codes.begin(), codes.end());
@@ -372,6 +374,8 @@ SimpleRetryResponseCodes::SimpleRetryResponseCodes(char *val)
     if (c > 399 && c < 500) {
       Debug("parent_select", "loading simple response code: %d", c);
       codes.push_back(c);
+    } else {
+      Warning("SimpleRetryResponseCodes received non-4xx code '%s', ignoring!", pTok[i]);
     }
   }
   std::sort(codes.begin(), codes.end());