You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/02/08 17:08:25 UTC

[GitHub] elsloo closed pull request #1849: TR: Log WARN rather than FATAL when a polling URL param isn't set

elsloo closed pull request #1849: TR: Log WARN rather than FATAL when a polling URL param isn't set
URL: https://github.com/apache/incubator-trafficcontrol/pull/1849
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 3304119bb1..5d081de867 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 boolean updateDatabase() {
 		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 fc8b30e6be..19898ff265 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 void before() throws Exception {
 	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());


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services