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 <ying.li@docker.com>
This commit is contained in:
Ying Li
2015-10-15 10:48:10 -07:00
parent a1edc02b82
commit a49406de42

View File

@@ -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()