multi: add shutdown logs in subservers

This commit adds a simple shutdown to every subserver to assist
debugging.
This commit is contained in:
yyforyongyu committed 2021-09-15 19:52:03 +08:00
1 parent 03bce2129b
commit 3204e2d74b
15 files changed
+24 -6

No files matched your search

+2
View File
@@ -118,6 +118,8 @@ func (b *BitcoindNotifier) Stop() error {
return nil
}
chainntnfs.Log.Info("bitcoind notifier shutting down")
// Shutdown the rpc client, this gracefully disconnects from bitcoind,
// and cleans up all related resources.
b.chainConn.Stop()
+2
View File
@@ -161,6 +161,8 @@ func (b *BtcdNotifier) Stop() error {
return nil
}
chainntnfs.Log.Info("btcd notifier shutting down")
// Shutdown the rpc client, this gracefully disconnects from btcd, and
// cleans up all related resources.
b.chainConn.Shutdown()
+2
View File
@@ -136,6 +136,8 @@ func (n *NeutrinoNotifier) Stop() error {
return nil
}
chainntnfs.Log.Info("neutrino notifier shutting down")
close(n.quit)
n.wg.Wait()
+1
View File
@@ -97,6 +97,7 @@ func (c *ChannelNotifier) Start() error {
func (c *ChannelNotifier) Stop() error {
var err error
c.stopped.Do(func() {
log.Info("ChannelNotifier shutting down")
err = c.ntfnServer.Stop()
})
return err
+1 -1
View File
@@ -893,7 +893,7 @@ func (c *ChainArbitrator) Stop() error {
return nil
}
log.Infof("Stopping ChainArbitrator")
log.Info("ChainArbitrator shutting down")
close(c.quit)
+4 -1
View File
@@ -467,7 +467,10 @@ func (d *AuthenticatedGossiper) start() error {
// Stop signals any active goroutines for a graceful closure.
func (d *AuthenticatedGossiper) Stop() error {
d.stopped.Do(d.stop)
d.stopped.Do(func() {
log.Info("Authenticated gossiper shutting down")
d.stop()
})
return nil
}
+3
View File
@@ -137,6 +137,9 @@ func (p *OnionProcessor) Start() error {
// Stop shutsdown the onion processor's sphinx router.
func (p *OnionProcessor) Stop() error {
log.Info("Onion processor shutting down")
p.router.Stop()
return nil
}
+1
View File
@@ -91,6 +91,7 @@ func (h *HtlcNotifier) Start() error {
func (h *HtlcNotifier) Stop() error {
var err error
h.stopped.Do(func() {
log.Info("HtlcNotifier shutting down")
if err = h.ntfnServer.Stop(); err != nil {
log.Warnf("error stopping htlc notifier: %v", err)
}
+1 -1
View File
@@ -1942,7 +1942,7 @@ func (s *Switch) Stop() error {
return errors.New("htlc switch already shutdown")
}
log.Infof("HTLC Switch shutting down")
log.Info("HTLC Switch shutting down")
close(s.quit)
+2
View File
@@ -257,6 +257,8 @@ func (i *InvoiceRegistry) Start() error {
// Stop signals the registry for a graceful shutdown.
func (i *InvoiceRegistry) Stop() error {
log.Info("InvoiceRegistry shutting down")
i.expiryWatcher.Stop()
close(i.quit)
+1
View File
@@ -217,6 +217,7 @@ func (m *ChanStatusManager) start() error {
// Stop safely shuts down the ChanStatusManager.
func (m *ChanStatusManager) Stop() error {
m.stopped.Do(func() {
log.Info("Channel Status Manager shutting down")
close(m.quit)
m.wg.Wait()
})
+1
View File
@@ -68,6 +68,7 @@ func (h *HostAnnouncer) Start() error {
// Stop signals the HostAnnouncer for a graceful stop.
func (h *HostAnnouncer) Stop() error {
h.stopOnce.Do(func() {
log.Info("HostAnnouncer shutting down")
close(h.quit)
h.wg.Wait()
})
+1 -1
View File
@@ -52,7 +52,7 @@ func (p *PeerNotifier) Start() error {
func (p *PeerNotifier) Stop() error {
var err error
p.stopped.Do(func() {
log.Info("Stopping PeerNotifier")
log.Info("PeerNotifier shutting down")
err = p.ntfnServer.Stop()
})
return err
+1 -1
View File
@@ -691,7 +691,7 @@ func (r *ChannelRouter) Stop() error {
return nil
}
log.Tracef("Channel Router shutting down")
log.Info("Channel Router shutting down")
// Our filtered chain view could've only been started if
// AssumeChannelValid isn't present.
+1 -1
View File
@@ -427,7 +427,7 @@ func (s *UtxoSweeper) Stop() error {
return nil
}
log.Debugf("Sweeper shutting down")
log.Info("Sweeper shutting down")
close(s.quit)
s.wg.Wait()