trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sor...@apache.org
Subject [trafficserver] 01/02: TS-4498: Log plugin remap error message.
Date Wed, 02 Nov 2016 16:47:20 GMT
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

commit c70125b79aefb16608d65614990132ff0a37411b
Author: Peter Chou <pbchou@labs.att.com>
AuthorDate: Wed Jun 1 15:44:08 2016 -0700

    TS-4498: Log plugin remap error message.
    
    Add error logging of the returned error message if a remap plugin
    fails to initialize. Currently it just says "bailing out" which is
    not as useful.
    
    (cherry-picked from commit 42becd0857b7cb4e39c6fc15efd4fc1e25fafe20)
---
 proxy/ControlMatcher.h          | 2 +-
 proxy/http/remap/RemapConfig.cc | 9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/proxy/ControlMatcher.h b/proxy/ControlMatcher.h
index 8592ec4..3d78669 100644
--- a/proxy/ControlMatcher.h
+++ b/proxy/ControlMatcher.h
@@ -106,7 +106,7 @@
     if (_already == false)                                  \
       pmgmt->signalManager(MGMT_SIGNAL_CONFIG_ERROR, _buf); \
     _already = true;                                        \
-    Warning("%s", _buf);                                    \
+    Error("%s", _buf);                                      \
   }
 
 class HostLookup;
diff --git a/proxy/http/remap/RemapConfig.cc b/proxy/http/remap/RemapConfig.cc
index 4565fb2..06ac82e 100644
--- a/proxy/http/remap/RemapConfig.cc
+++ b/proxy/http/remap/RemapConfig.cc
@@ -800,7 +800,8 @@ remap_load_plugin(const char **argv, int argc, url_mapping *mp, char *errbuf,
in
       ri.tsremap_version = TSREMAP_VERSION;
 
       if (pi->fp_tsremap_init(&ri, tmpbuf, sizeof(tmpbuf) - 1) != TS_SUCCESS) {
-        Warning("Failed to initialize plugin %s (non-zero retval) ... bailing out", pi->path);
+        snprintf(errbuf, errbufsize, "Failed to initialize plugin \"%s\": %s", pi->path,
+                 tmpbuf[0] ? tmpbuf : "Unknown plugin error");
         return -5;
       }
     } // done elevating access
@@ -867,9 +868,8 @@ remap_load_plugin(const char **argv, int argc, url_mapping *mp, char *errbuf,
in
   ats_free(parv[1]); // toURL
 
   if (res != TS_SUCCESS) {
-    snprintf(errbuf, errbufsize, "Can't create new remap instance for plugin \"%s\" - %s",
c,
+    snprintf(errbuf, errbufsize, "Failed to create instance for plugin \"%s\": %s", c,
              tmpbuf[0] ? tmpbuf : "Unknown plugin error");
-    Warning("Failed to create new instance for plugin %s (not a TS_SUCCESS return)", pi->path);
     return -8;
   }
 
@@ -1346,8 +1346,7 @@ remap_parse_config_bti(const char *path, BUILD_TABLE_INFO *bti)
 
   // Deal with error / warning scenarios
   MAP_ERROR:
-    Warning("Could not add rule at line #%d; Aborting!", cln + 1);
-    snprintf(errBuf, sizeof(errBuf), "%s %s at line %d", modulePrefix, errStr, cln + 1);
+    snprintf(errBuf, sizeof(errBuf), "%s failed to add remap rule at %s line %d: %s", modulePrefix,
path, cln + 1, errStr);
     SignalError(errBuf, alarm_already);
     delete reg_map;
     delete new_mapping;

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

Mime
View raw message