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

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new a21fba9  Log WARN rather than FATAL when a polling URL param isn't set
a21fba9 is described below

commit a21fba9e702d90fde7d52891fbc02b65eb355e90
Author: Rawlin Peters <rawlin_pet...@comcast.com>
AuthorDate: Mon Feb 5 15:31:04 2018 -0700

    Log WARN rather than FATAL when a polling URL param isn't set
    
    For example, deepcoveragezone.polling.url can remain unset if the CDN
    operator doesn't want to use the Deep Caching feature. Rather than
    logging FATAL with a stacktrace, just log it as a warning.
---
 .../traffic_router/core/loc/AbstractServiceUpdater.java           | 8 +++++++-
 .../traffic_router/core/loc/AbstractServiceUpdaterTest.java       | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdater.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdater.java
index 3304119..5d081de 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdater.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdater.java
@@ -125,9 +125,15 @@ public abstract class AbstractServiceUpdater {
                File newDB = null;
                boolean isModified = true;
 
+               final String databaseURL = getDataBaseURL();
+               if (databaseURL == null) {
+                       LOGGER.warn("[" + getClass().getSimpleName() + "] 
Skipping download/update: database URL is null");
+                       return false;
+               }
+
                try {
                        try {
-                               newDB = downloadDatabase(getDataBaseURL(), 
existingDB);
+                               newDB = downloadDatabase(databaseURL, 
existingDB);
                                trafficRouterManager.trackEvent("last" + 
getClass().getSimpleName() + "Check");
 
                                // if the remote db's timestamp is less than or 
equal to ours, the above returns existingDB
diff --git 
a/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdaterTest.java
 
b/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdaterTest.java
index fc8b30e..19898ff 100644
--- 
a/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdaterTest.java
+++ 
b/traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/AbstractServiceUpdaterTest.java
@@ -78,6 +78,7 @@ public class AbstractServiceUpdaterTest {
        public void itUsesETag() throws Exception {
                Updater updater = new Updater();
                updater.setDatabasesDirectory(databasesDirectory);
+               updater.dataBaseURL = "http://www.example.com";;
                updater.updateDatabase();
 
                verify(connection, 
times(0)).setRequestProperty(eq("If-None-Match"), anyString());

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.

Reply via email to