stop birpc listeners on engine shutdown

make goroutine wait on shdChan and call StopBiRPC to close the
listener(s). Connection goroutines still leak (they need to be
fixed on birpc library side).
This commit is contained in:
ionutboangiu
2026-02-17 17:29:03 +02:00
committed by Dan Christian Bogos
parent 7983a319db
commit 19ac633e1a

View File

@@ -264,6 +264,10 @@ func startBiRPC(smg *SessionService, tS *ThresholdService, server *cores.Server,
}
},
}
go func() {
<-shdChan.Done()
server.StopBiRPC()
}()
if err := server.ServeBiRPC(cfg.ListenCfg().BiJSONListen, cfg.ListenCfg().BiGobListen, onConns, onDiss); err != nil {
utils.Logger.Err(fmt.Sprintf("<%s> serve BiRPC error: %s!", utils.SessionS, err))
shdChan.CloseOnce()