Skip to content

Commit

Permalink
Fix standalone execution
Browse files Browse the repository at this point in the history
Add infinite loop at the end of startStandAlone() to prevent
the server process from exiting immediately after bootstrap.

Closes: #4879
  • Loading branch information
Alessio Treglia committed Aug 10, 2019
1 parent e4c8bd7 commit 4afe163
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .pending/bugfixes/tendermint/_4879-Don-t-terminat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#4879 Don't terminate the process immediately after startup when run in standalone mode.
5 changes: 4 additions & 1 deletion server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,17 @@ func startStandAlone(ctx *Context, appCreator AppCreator) error {
cmn.Exit(err.Error())
}

// wait forever
cmn.TrapSignal(ctx.Logger, func() {
// cleanup
err = svr.Stop()
if err != nil {
cmn.Exit(err.Error())
}
})

// run forever (the node will not be returned)
select {}

return nil
}

Expand Down

0 comments on commit 4afe163

Please sign in to comment.