You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ra...@apache.org on 2020/11/19 22:26:58 UTC

[trafficcontrol] branch master updated: Fix Traffic Monitor Log Spam (#5309)

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

rawlin 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 a231355  Fix Traffic Monitor Log Spam (#5309)
a231355 is described below

commit a2313553db3a5c7b0176e0205eee345854dc695d
Author: ocket8888 <oc...@apache.org>
AuthorDate: Thu Nov 19 15:26:43 2020 -0700

    Fix Traffic Monitor Log Spam (#5309)
    
    * Add Anjuta IDE files to .gitignore
    
    * Add Kate IDE project files to .gitignore
    
    * Fixed TM spamming logs for ADMIN_DOWN cache servers
---
 .gitignore                      | 4 ++++
 traffic_monitor/health/cache.go | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 54af8de..a07904b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,6 +65,10 @@ local.tar.gz
 .projectile
 *.bak
 *.iml
+.anjuta/
+.anjuta_sym_db.db
+*.anjuta
+*.kateproject
 # built local binaries
 ./traffic_ops_golang
 # Created by TP/TO docker integration tests
diff --git a/traffic_monitor/health/cache.go b/traffic_monitor/health/cache.go
index 208e837..899187f 100644
--- a/traffic_monitor/health/cache.go
+++ b/traffic_monitor/health/cache.go
@@ -87,6 +87,9 @@ func GetVitals(newResult *cache.Result, prevResult *cache.Result, mc *tc.Traffic
 
 }
 
+// EvalCacheWithStatusInfo evaluates whether the given cache should be marked
+// available, taking the server's configured Status into account as well as its
+// polling information.
 func EvalCacheWithStatusInfo(result cache.ResultInfo, mc *tc.TrafficMonitorConfigMap, status tc.CacheStatus, serverStatus string) (bool, string, string) {
 	availability := AvailableStr
 	if !result.Available {
@@ -143,6 +146,8 @@ func EvalInterface(infVitals map[string]cache.Vitals, inf tc.ServerInterfaceInfo
 	return true, ""
 }
 
+// EvalAggregate calculates the availability of a cache server as an aggregate
+// of server metrics and metrics of its network interfaces.
 func EvalAggregate(result cache.ResultInfo, resultStats *threadsafe.ResultStatValHistory, mc *tc.TrafficMonitorConfigMap) (bool, string, string) {
 	serverInfo, ok := mc.TrafficServer[string(result.ID)]
 	if !ok {
@@ -322,7 +327,7 @@ func CalcAvailability(
 			Ipv6Available: availStatus.Available.IPv6,
 		})
 
-		if available, ok := localStates.GetCache(tc.CacheName(result.ID)); !ok || !available.IsAvailable || !availStatus.ProcessedAvailable {
+		if available, ok := localStates.GetCache(tc.CacheName(result.ID)); !ok || available.IsAvailable != lastStatus.ProcessedAvailable {
 			protocol := "IPv4"
 			if !availStatus.LastCheckedIPv4 {
 				protocol = "IPv6"