From 45d15cb8ee83886471e2e74c9cb4fdbc30618a7b Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Mon, 23 May 2022 09:29:11 -0700 Subject: [PATCH] handle error during liveness check --- node/health.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/node/health.go b/node/health.go index a92997a61d6..99c3e03ae5a 100644 --- a/node/health.go +++ b/node/health.go @@ -6,9 +6,12 @@ import ( "time" lapi "github.com/filecoin-project/lotus/api" + logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/network" ) +var healthlog = logging.Logger("healthcheck") + type HealthHandler struct { healthy bool } @@ -36,7 +39,9 @@ func NewLiveHandler(api lapi.FullNode) *HealthHandler { minutely := time.NewTicker(time.Minute) headCh, err := api.ChainNotify(ctx) if err != nil { - //TODO + healthlog.Warnf("failed to instantiate chain notify channel; liveliness cannot be determined. %s", err) + h.SetHealthy(false) + return } for { select {