You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by el...@apache.org on 2019/02/11 16:09:20 UTC
[trafficcontrol] branch master updated: Improve handling of faulty
CRConfig DS-server assignments in TR
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/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new a79aad6 Improve handling of faulty CRConfig DS-server assignments in TR
a79aad6 is described below
commit a79aad683cf433eaa217ac21d9bb6bc67a652e32
Author: Rawlin Peters <ra...@comcast.com>
AuthorDate: Fri Feb 8 11:12:46 2019 -0700
Improve handling of faulty CRConfig DS-server assignments in TR
If a server has a reference to a delivery service but the delivery
service does not exist (i.e.
crconfig["contentServers"]["cache1"]["deliveryServices"] contains a DS
xml_id that doesn't have a matching delivery service in
crconfig["deliveryServices"]) Traffic Router should log a warning for
that error and continue rather than throwing a NullPointerException.
The bad generation of the CRConfig will be fixed separately.
---
.../cdn/traffic_control/traffic_router/core/dns/ZoneManager.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/dns/ZoneManager.java b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/dns/ZoneManager.java
index 2703dcb..88cd44b 100644
--- a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/dns/ZoneManager.java
+++ b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/dns/ZoneManager.java
@@ -620,6 +620,10 @@ public class ZoneManager extends Resolver {
for (final Cache c : data.getCacheMap().values()) {
for (final DeliveryServiceReference dsr : c.getDeliveryServices()) {
final DeliveryService ds = data.getDeliveryService(dsr.getDeliveryServiceId());
+ if (ds == null) {
+ LOGGER.warn("Content server " + c.getFqdn() + " has delivery service " + dsr.getDeliveryServiceId() + " assigned, but the delivery service was not found. Skipping.");
+ continue;
+ }
final String fqdn = dsr.getFqdn();
final String[] parts = fqdn.split("\\.", 2);
final String host = parts[0];