You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2016/06/03 22:15:41 UTC

[trafficserver] branch master updated: TS-4489: Log plugin remap error message.

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

jpeach 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  42becd0   TS-4489: Log plugin remap error message.
42becd0 is described below

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

    TS-4489: 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.
    
    This closes #690.
---
 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 4682fb1..8a6ce8e 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 80c046a..a6133aa 100644
--- a/proxy/http/remap/RemapConfig.cc
+++ b/proxy/http/remap/RemapConfig.cc
@@ -802,7 +802,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
@@ -869,9 +870,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;
   }
 
@@ -1348,8 +1348,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" <co...@trafficserver.apache.org>'].