[ARVADOS] updated: 2.1.0-1589-ge7aec8c18

Git user git at public.arvados.org
Tue Nov 9 21:59:54 UTC 2021


Summary of changes:
 lib/controller/localdb/conn.go | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

       via  e7aec8c18af9ae99d0a43c1d172d8598ee8bf577 (commit)
      from  f827088cc812a217bfb46aca66be62b79b7ed973 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e7aec8c18af9ae99d0a43c1d172d8598ee8bf577
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Tue Nov 9 18:59:23 2021 -0300

    17944: Fixes logging on vocabulary reload.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/lib/controller/localdb/conn.go b/lib/controller/localdb/conn.go
index 86e3f3714..323e660c6 100644
--- a/lib/controller/localdb/conn.go
+++ b/lib/controller/localdb/conn.go
@@ -18,6 +18,7 @@ import (
 	"git.arvados.org/arvados.git/sdk/go/arvados"
 	"git.arvados.org/arvados.git/sdk/go/ctxlog"
 	"git.arvados.org/arvados.git/sdk/go/httpserver"
+	"github.com/sirupsen/logrus"
 )
 
 type railsProxy = rpc.Conn
@@ -70,7 +71,7 @@ func (conn *Conn) checkProperties(ctx context.Context, properties interface{}) e
 	return nil
 }
 
-func (conn *Conn) maybeRefreshVocabularyCache() error {
+func (conn *Conn) maybeRefreshVocabularyCache(logger logrus.FieldLogger) error {
 	if conn.lastVocabularyRefreshCheck.Add(time.Second).After(time.Now()) {
 		// Throttle the access to disk to at most once per second.
 		return nil
@@ -90,6 +91,7 @@ func (conn *Conn) maybeRefreshVocabularyCache() error {
 		}
 		conn.vocabularyFileModTime = fi.ModTime()
 		conn.lastVocabularyError = nil
+		logger.Info("vocabulary file reloaded successfully")
 	}
 	return nil
 }
@@ -113,8 +115,9 @@ func (conn *Conn) loadVocabularyFile() error {
 
 // LastVocabularyError returns the last error encountered while loading the
 // vocabulary file.
+// Implements health.Func
 func (conn *Conn) LastVocabularyError() error {
-	conn.maybeRefreshVocabularyCache()
+	conn.maybeRefreshVocabularyCache(ctxlog.FromContext(context.Background()))
 	return conn.lastVocabularyError
 }
 
@@ -134,11 +137,9 @@ func (conn *Conn) VocabularyGet(ctx context.Context) (arvados.Vocabulary, error)
 			return arvados.Vocabulary{}, err
 		}
 	}
-	err := conn.maybeRefreshVocabularyCache()
+	err := conn.maybeRefreshVocabularyCache(logger)
 	if err != nil {
 		logger.WithError(err).Error("error reloading vocabulary file - ignoring")
-	} else {
-		logger.Info("vocabulary file reloaded successfully")
 	}
 	return *conn.vocabularyCache, nil
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list