multi: add debug logs to catch slow shutdown

This commit is contained in:
yyforyongyu authored and Olaoluwa Osuntokun committed 2023-10-06 16:34:47 -07:00
1 parent ba007d9373
commit 66b8700c0b
24 files changed
+59 -23

No files matched your search

+5
View File
@@ -2328,8 +2328,10 @@ func (s *server) Stop() error {
}
// Wait for all lingering goroutines to quit.
srvrLog.Debug("Waiting for server to shutdown...")
s.wg.Wait()
srvrLog.Debug("Stopping buffer pools...")
s.sigPool.Stop()
s.writePool.Stop()
s.readPool.Stop()
@@ -3957,6 +3959,9 @@ func (s *server) peerInitializer(p *peer.Brontide) {
// Start the peer! If an error occurs, we Disconnect the peer, which
// will unblock the peerTerminationWatcher.
if err := p.Start(); err != nil {
srvrLog.Warnf("Starting peer=%v got error: %v",
p.IdentityKey(), err)
p.Disconnect(fmt.Errorf("unable to start peer: %v", err))
return
}