From a49406de42dfdaf57be1a4a4cc042f09c171ddf6 Mon Sep 17 00:00:00 2001 From: Ying Li Date: Thu, 15 Oct 2015 10:48:10 -0700 Subject: [PATCH] Log an error if the notary server cannot reach the signer or otherwise if the signer is in trouble, but do not fail the health check, since the server can operate for a while without the signer (the server will have degraded performance, but is not down) Signed-off-by: Ying Li --- cmd/notary-server/main.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cmd/notary-server/main.go b/cmd/notary-server/main.go index fb6adbf1b7..bae7cd8d68 100644 --- a/cmd/notary-server/main.go +++ b/cmd/notary-server/main.go @@ -115,10 +115,19 @@ func main() { ) health.RegisterPeriodicFunc( "Trust operational", + // If the trust service fails, the server is degraded but not + // exactly unheatlthy, so always return healthy and just log an + // error. func() error { - return trust.(*signer.NotarySigner).CheckHealth(60) + logrus.Info("Getting health") + err := trust.(*signer.NotarySigner).CheckHealth(5) + logrus.Info("Got health") + if err != nil { + logrus.Error("Trust not fully operational: ", err.Error()) + } + return nil }, - time.Second*60) + time.Second*5) } else { logrus.Info("Using local signing service") trust = signed.NewEd25519()