master fix interruption through ctrl+c (#3834)

This commit is contained in:
Konstantin Lebedev
2022-10-12 19:18:40 +05:00
committed by GitHub
parent a05725aea6
commit 401315f337
2 changed files with 9 additions and 1 deletions

View File

@@ -255,7 +255,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
}
grace.OnInterrupt(ms.Shutdown)
grace.OnInterrupt(grpcS.GracefulStop)
grace.OnInterrupt(grpcS.Stop)
grace.OnReload(func() {
if ms.Topo.HashicorpRaft != nil && ms.Topo.HashicorpRaft.State() == hashicorpRaft.Leader {
ms.Topo.HashicorpRaft.LeadershipTransfer()