feat: make abci handshake graceful interruptible (#16206)
This commit is contained in:
+6
-4
@@ -289,13 +289,15 @@ func startInProcess(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clien
|
||||
|
||||
gRPCOnly := svrCtx.Viper.GetBool(flagGRPCOnly)
|
||||
|
||||
g, ctx := getCtx(svrCtx, true)
|
||||
|
||||
if gRPCOnly {
|
||||
// TODO: Generalize logic so that gRPC only is really in startStandAlone
|
||||
svrCtx.Logger.Info("starting node in gRPC only mode; CometBFT is disabled")
|
||||
svrCfg.GRPC.Enable = true
|
||||
} else {
|
||||
svrCtx.Logger.Info("starting node with ABCI CometBFT in-process")
|
||||
tmNode, cleanupFn, err := startCmtNode(cmtCfg, app, svrCtx)
|
||||
tmNode, cleanupFn, err := startCmtNode(ctx, cmtCfg, app, svrCtx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -315,8 +317,6 @@ func startInProcess(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clien
|
||||
}
|
||||
}
|
||||
|
||||
g, ctx := getCtx(svrCtx, true)
|
||||
|
||||
grpcSrv, clientCtx, err := startGrpcServer(ctx, g, svrCfg.GRPC, clientCtx, svrCtx, app)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -340,6 +340,7 @@ func startInProcess(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clien
|
||||
|
||||
// TODO: Move nodeKey into being created within the function.
|
||||
func startCmtNode(
|
||||
ctx context.Context,
|
||||
cfg *cmtcfg.Config,
|
||||
app types.Application,
|
||||
svrCtx *Context,
|
||||
@@ -350,7 +351,8 @@ func startCmtNode(
|
||||
}
|
||||
|
||||
cmtApp := NewCometABCIWrapper(app)
|
||||
tmNode, err = node.NewNode(
|
||||
tmNode, err = node.NewNodeWithContext(
|
||||
ctx,
|
||||
cfg,
|
||||
pvm.LoadOrGenFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()),
|
||||
nodeKey,
|
||||
|
||||
Reference in New Issue
Block a user