From 0ae38457dedf8ef136b34490271ef4d75ef2554d Mon Sep 17 00:00:00 2001 From: carla Date: Thu, 20 Jan 2022 14:21:36 +0200 Subject: [PATCH 1/2] server: disable chain health check if we're running without backend There is no chain backend to check, so this check will always fail. This commit disables it when we're running without a backend. --- server.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 1aceebc14..ac18a5ae5 100644 --- a/server.go +++ b/server.go @@ -1501,20 +1501,28 @@ func newServer(cfg *Config, listenAddrs []net.Addr, // createLivenessMonitor creates a set of health checks using our configured // values and uses these checks to create a liveliness monitor. Available // health checks, -// - chainHealthCheck +// - chainHealthCheck (will be disabled for --nochainbackend mode) // - diskCheck // - tlsHealthCheck // - torController, only created when tor is enabled. // If a health check has been disabled by setting attempts to 0, our monitor // will not run it. func (s *server) createLivenessMonitor(cfg *Config, cc *chainreg.ChainControl) { + chainBackendAttempts := cfg.HealthChecks.ChainCheck.Attempts + if cfg.Bitcoin.Node == "nochainbackend" { + srvrLog.Info("Disabling chain backend checks for " + + "nochainbackend mode") + + chainBackendAttempts = 0 + } + chainHealthCheck := healthcheck.NewObservation( "chain backend", cc.HealthCheck, cfg.HealthChecks.ChainCheck.Interval, cfg.HealthChecks.ChainCheck.Timeout, cfg.HealthChecks.ChainCheck.Backoff, - cfg.HealthChecks.ChainCheck.Attempts, + chainBackendAttempts, ) diskCheck := healthcheck.NewObservation( From 72416535611cdabc84635e3a25cfe05c8e54d186 Mon Sep 17 00:00:00 2001 From: carla Date: Thu, 20 Jan 2022 14:31:47 +0200 Subject: [PATCH 2/2] docs: add release notes --- docs/release-notes/release-notes-0.15.0.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/release-notes/release-notes-0.15.0.md b/docs/release-notes/release-notes-0.15.0.md index 5ce636b74..768b374cc 100644 --- a/docs/release-notes/release-notes-0.15.0.md +++ b/docs/release-notes/release-notes-0.15.0.md @@ -51,6 +51,8 @@ * [A nightly build of the `lnd` docker image is now created automatically](https://github.com/lightningnetwork/lnd/pull/6160). +* [Chain backend healthchecks disabled for --nochainbackend mode](https://github.com/lightningnetwork/lnd/pull/6184) + ## RPC Server * [Add value to the field