Repository navigation
subservers: report remote sub-server disconnects at runtime - #1373
Vandit1604 wants to merge 11 commits into
Conversation
9d4b8ed to
af43e4c
Compare
af43e4c to
f75779f
Compare
|
@ViktorT-11: review reminder |
Cyberguru1
left a comment
There was a problem hiding this comment.
Great contribution, @Vandit1604 🙌
I’ve done a first-pass review and left a few comments below.
| // status server reflects a runtime disconnect instead of keeping the | ||
| // sub-server marked as running. The watcher stops when the sub-server is | ||
| // stopped. | ||
| func (s *subServerWrapper) watchRemoteConn(onError func(error), |
There was a problem hiding this comment.
It might be worth adding an isWatching flag to subServerWrapper to make watchRemoteConn idempotent. Checking this before starting the goroutine lets any extra calls exit early, so we avoid spawning duplicate goroutines and triggering duplicate error callbacks.
| close(ss.quit) | ||
| ss.wg.Wait() |
There was a problem hiding this comment.
Could we switch this to require.NoError(t, ss.stop()) so we exercise the full teardown logic and close remoteConn properly.
Just like Name(), we will also need to add Remote() to nameOnlySubServer. When I tested ss.stop() locally without it, it panicked with a nil pointer dereference when stop() evaluated s.Remote().
0d217d5 to
e46ad38
Compare
commented
Sep 24, 2026
|
@Vandit1604, remember to re-request review from reviewers when ready |
e46ad38 to
c919e71
Compare
commented
Sep 24, 2026
|
Hi @Cyberguru1, thanks for the review! |
commented
Oct 1, 2026
|
@ViktorT-11: review reminder |
left a comment
There was a problem hiding this comment.
Great work @Vandit1604 , the PR is almost in shape 🔥
Apologies for the late response 🙏
I ran some more tests after your fixes. Left a review below:
| } | ||
|
|
||
| s.wg.Add(1) | ||
| go func() { |
There was a problem hiding this comment.
Can we reset watching to false via defer in the goroutine? Otherwise if the subserver reconnects after the goroutine exits, it'd see true and skip starting a new watcher.
commented
Oct 6, 2026
|
While testing this round, I found that @Cyberguru1 this is ready for another look when you have time. |
commented
Oct 13, 2026
|
@ViktorT-11: review reminder |
46ae104 to
c8b4604
Compare
commented
Oct 20, 2026
|
@Vandit1604, remember to re-request review from reviewers when ready |
left a comment
•
There was a problem hiding this comment.
Great work, @Vandit1604! 🔥
LGTM, tACK.
This needs a rebase.
c8b4604 to
bc06585
Compare
commented
Oct 28, 2026
|
#1440 moved the @Cyberguru1 this part changed after your approval. @ViktorT-11 ready for you too. |
commented
Nov 4, 2026
|
@ViktorT-11: review reminder |
bc06585 to
a018967
Compare
commented
Nov 12, 2026
|
@ViktorT-11: review reminder |
a018967 to
c53d952
Compare
commented
Nov 23, 2026
|
@ViktorT-11: review reminder |
Change
In remote mode, a sub-server that disconnected after startup was still reported as
runningby the status server, solitcli statuskept showing it as healthy. Only failures during startup were tracked; a disconnect at runtime was not.This adds a watcher on each remote sub-server's gRPC connection. When the connection drops (
TransientFailure/Shutdown) the sub-server is marked errored, and when it recovers (Ready) it is marked running again, so the status server reflects the real runtime state.Two smaller things came along with it:
Manager.Stopnow also tears down remote sub-servers (it skipped them before), so the watcher and the remote connection are stopped on shutdown. The remote branch instop()was effectively dead before, since remote servers never reached it.status.SetErroredlogged "could not start the X sub-server", which is wrong for a runtime disconnect, so the log is now neutral.Note: the watcher nudges an idle connection with
conn.Connect()so a disconnect is still observed when no requests are in flight. That keeps the remote connection warm rather than letting it idle out, which is the trade-off for observability here.Scope
This is the first, smallest step towards #644, as suggested by @ViktorT-11: get the status reporting right before adding any reconnect/restart logic. It intentionally does not restart sub-servers or touch the lnd reconnect path.
Known gaps left as follow-ups:
pool/faradayexpose no runtime error channel, so their disconnects are still not tracked.Testing
TestWatchRemoteConnstarts a real gRPC backend, stops it, and asserts the disconnect is reported, then restarts it and asserts the recovery is reported.Part of #644.