From bbbb35189732dce54259a5d1002e7ebf27b68051 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 1 Jun 2023 16:15:31 -0400 Subject: [PATCH] Get rid of log messages from SrvKeyspaceWatcher when no node/key Signed-off-by: Matt Lord --- go/vt/srvtopo/watch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/srvtopo/watch.go b/go/vt/srvtopo/watch.go index 2d571f4930f..2d470327c4e 100644 --- a/go/vt/srvtopo/watch.go +++ b/go/vt/srvtopo/watch.go @@ -195,7 +195,7 @@ func (entry *watchEntry) onErrorLocked(err error, init bool) { // This watcher will able to continue to return the last value till it is not able to connect to the topo server even if the cache TTL is reached. // TTL cache is only checked if the error is a known error i.e topo.Error. _, isTopoErr := err.(topo.Error) - if isTopoErr && time.Since(entry.lastValueTime) > entry.rw.cacheTTL { + if entry.value != nil && isTopoErr && time.Since(entry.lastValueTime) > entry.rw.cacheTTL { log.Errorf("WatchSrvKeyspace clearing cached entry for %v", entry.key) entry.value = nil }