Merge pull request #6184 from carlaKC/healthcheck-nochainbackend
server: disable chain health check if we're running without backend
This commit is contained in:
2 files changed
+12
-2
No files matched your search
@@ -53,6 +53,8 @@
|
|||||||
|
|
||||||
* [Add `.vs/` folder to `.gitignore`](https://github.com/lightningnetwork/lnd/pull/6178).
|
* [Add `.vs/` folder to `.gitignore`](https://github.com/lightningnetwork/lnd/pull/6178).
|
||||||
|
|
||||||
|
* [Chain backend healthchecks disabled for --nochainbackend mode](https://github.com/lightningnetwork/lnd/pull/6184)
|
||||||
|
|
||||||
## RPC Server
|
## RPC Server
|
||||||
|
|
||||||
* [Add value to the field
|
* [Add value to the field
|
||||||
|
|||||||
@@ -1501,20 +1501,28 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
|||||||
// createLivenessMonitor creates a set of health checks using our configured
|
// createLivenessMonitor creates a set of health checks using our configured
|
||||||
// values and uses these checks to create a liveliness monitor. Available
|
// values and uses these checks to create a liveliness monitor. Available
|
||||||
// health checks,
|
// health checks,
|
||||||
// - chainHealthCheck
|
// - chainHealthCheck (will be disabled for --nochainbackend mode)
|
||||||
// - diskCheck
|
// - diskCheck
|
||||||
// - tlsHealthCheck
|
// - tlsHealthCheck
|
||||||
// - torController, only created when tor is enabled.
|
// - torController, only created when tor is enabled.
|
||||||
// If a health check has been disabled by setting attempts to 0, our monitor
|
// If a health check has been disabled by setting attempts to 0, our monitor
|
||||||
// will not run it.
|
// will not run it.
|
||||||
func (s *server) createLivenessMonitor(cfg *Config, cc *chainreg.ChainControl) {
|
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(
|
chainHealthCheck := healthcheck.NewObservation(
|
||||||
"chain backend",
|
"chain backend",
|
||||||
cc.HealthCheck,
|
cc.HealthCheck,
|
||||||
cfg.HealthChecks.ChainCheck.Interval,
|
cfg.HealthChecks.ChainCheck.Interval,
|
||||||
cfg.HealthChecks.ChainCheck.Timeout,
|
cfg.HealthChecks.ChainCheck.Timeout,
|
||||||
cfg.HealthChecks.ChainCheck.Backoff,
|
cfg.HealthChecks.ChainCheck.Backoff,
|
||||||
cfg.HealthChecks.ChainCheck.Attempts,
|
chainBackendAttempts,
|
||||||
)
|
)
|
||||||
|
|
||||||
diskCheck := healthcheck.NewObservation(
|
diskCheck := healthcheck.NewObservation(
|
||||||
|
|||||||
Reference in new issue
Block a user