From f96bbe8cfaaa26de81b24055572645e22f624c64 Mon Sep 17 00:00:00 2001 From: ffranr Date: Tue, 2 Dec 2025 20:21:24 +0000 Subject: [PATCH 1/2] subservers: fail LiT startup when integrated sub-server boot fails * Treat integrated sub-servers as fatal to startup and return an error if any fail to start. * Propagate integrated sub-server startup errors to LiT so it stops launching and records the failure status. * Update docs to reflect integrated sub-servers are now critical to startup. --- subservers/interface.go | 5 ++--- subservers/manager.go | 16 ++++++++++++++-- terminal.go | 5 ++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/subservers/interface.go b/subservers/interface.go index 4ff0083cf..969a73688 100644 --- a/subservers/interface.go +++ b/subservers/interface.go @@ -14,9 +14,8 @@ import ( // SubServer defines an interface that should be implemented by any sub-server // that the subServer manager should manage. A sub-server can be run in either -// integrated or remote mode. A sub-server is considered non-fatal to LiT -// meaning that if a sub-server fails to start, LiT can safely continue with its -// operations and other sub-servers can too. +// integrated or remote mode. Integrated sub-servers are treated as critical to +// LiT startup, meaning a failure to start any of them will abort the process. type SubServer interface { macaroons.MacaroonValidator diff --git a/subservers/manager.go b/subservers/manager.go index 8d9f6b1b3..4543806c9 100644 --- a/subservers/manager.go +++ b/subservers/manager.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "io/ioutil" + "strings" "sync" "time" @@ -104,13 +105,16 @@ func (s *Manager) GetServer(name string) (SubServer, bool) { } // StartIntegratedServers starts all the manager's sub-servers that should be -// started in integrated mode. +// started in integrated mode. An error is returned if any integrated sub-server +// fails to start. func (s *Manager) StartIntegratedServers(lndClient lnrpc.LightningClient, - lndGrpc *lndclient.GrpcLndServices, withMacaroonService bool) { + lndGrpc *lndclient.GrpcLndServices, withMacaroonService bool) error { s.mu.Lock() defer s.mu.Unlock() + var errs []string + for _, ss := range s.servers { if ss.Remote() { continue @@ -126,11 +130,19 @@ func (s *Manager) StartIntegratedServers(lndClient lnrpc.LightningClient, ) if err != nil { s.statusServer.SetErrored(ss.Name(), err.Error()) + errs = append(errs, fmt.Sprintf("%s: %v", ss.Name(), err)) continue } s.statusServer.SetRunning(ss.Name()) } + + if len(errs) > 0 { + return fmt.Errorf("failed starting integrated sub-server(s): %s", + strings.Join(errs, "; ")) + } + + return nil } // ConnectRemoteSubServers creates connections to all the manager's sub-servers diff --git a/terminal.go b/terminal.go index 992bcaf7b..98b42688b 100644 --- a/terminal.go +++ b/terminal.go @@ -768,9 +768,12 @@ func (g *LightningTerminal) start(ctx context.Context) error { // Both connection types are ready now, let's start our sub-servers if // they should be started locally as an integrated service. createDefaultMacaroons := !g.cfg.statelessInitMode - g.subServerMgr.StartIntegratedServers( + err = g.subServerMgr.StartIntegratedServers( g.basicClient, g.lndClient, createDefaultMacaroons, ) + if err != nil { + return fmt.Errorf("could not start integrated sub-servers: %w", err) + } err = g.startInternalSubServers(ctx, !g.cfg.statelessInitMode) if err != nil { From 86e8ec5d3769af3c1dc11c2085f37b1f3cc29ac6 Mon Sep 17 00:00:00 2001 From: ffranr Date: Thu, 4 Dec 2025 13:21:19 +0000 Subject: [PATCH 2/2] docs: add release note --- docs/release-notes/release-notes-0.16.1.md | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 docs/release-notes/release-notes-0.16.1.md diff --git a/docs/release-notes/release-notes-0.16.1.md b/docs/release-notes/release-notes-0.16.1.md new file mode 100644 index 000000000..1c4aede20 --- /dev/null +++ b/docs/release-notes/release-notes-0.16.1.md @@ -0,0 +1,42 @@ +# Release Notes + +- [Lightning Terminal](#lightning-terminal) + - [Bug Fixes](#bug-fixes) + - [Functional Changes/Additions](#functional-changesadditions) + - [Technical and Architectural Updates](#technical-and-architectural-updates) +- [Integrated Binary Updates](#integrated-binary-updates) + - [LND](#lnd) + - [Loop](#loop) + - [Pool](#pool) + - [Faraday](#faraday) + - [Taproot Assets](#taproot-assets) +- [Contributors](#contributors-alphabetical-order) + +## Lightning Terminal + +### Bug Fixes + +### Functional Changes/Additions + +* [PR](https://github.com/lightninglabs/lightning-terminal/pull/1183): LiT now + fails fast if any integrated sub-server cannot start. Startup errors from + integrated sub-servers are propagated directly to LiT, which aborts launch + and records the failure status. + +### Technical and Architectural Updates + +## RPC Updates + +## Integrated Binary Updates + +### LND + +### Loop + +### Pool + +### Faraday + +### Taproot Assets + +# Contributors (Alphabetical Order) \ No newline at end of file