Skip to content

Kill Tendermint when App dies#794

Merged
ebuchman merged 1 commit intodevelopfrom
243-restart-app-via-os
Oct 31, 2017
Merged

Kill Tendermint when App dies#794
ebuchman merged 1 commit intodevelopfrom
243-restart-app-via-os

Conversation

@ebuchman
Copy link
Contributor

#243 (comment)

Tendermint should die if app hash does so OS can handle restarts

Copy link
Contributor

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ebuchman, LGTM but just one nit left.

@@ -1204,6 +1204,10 @@ func (cs *ConsensusState) finalizeCommit(height int) {
err := stateCopy.ApplyBlock(eventCache, cs.proxyAppConn, block, blockParts.Header(), cs.mempool)
if err != nil {
cs.Logger.Error("Error on ApplyBlock. Did the application crash? Please restart tendermint", "err", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should remove this error message then and instead make it

if err != nil {
    if err := cmn.Kill(); err != nil {
        // Maybe log that we successfully killed Tendermint
    } else {
        cs.Logger.Error("Error on ApplyBlock. Did the application crash? Please restart Tendermint manually", "err", err)
    }
    return
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to alert the user when the app crashes, and then initiate tear down. If tear down fails, we should log that error too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, at least let's change the message asking them to start Tendermint yet we are doing it right after logging the message
screen shot 2017-10-28 at 3 44 42 pm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? We tell the user to restart tendermint, and then we go and kill it. So then they, or their OS, can restart it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops I was definitely mistaken. For some reason when I read the commit message Tendermint should die if app hash does so OS can handle restarts I assumed that Tendermint would be auto-restarted or the OS would handle it exiting, but I re-read everything after your comment. My apologies.

@zramsay zramsay added this to the 0.13.0 milestone Oct 28, 2017
@ebuchman ebuchman force-pushed the 243-restart-app-via-os branch from 8d70f39 to fe1c60b Compare October 31, 2017 19:23
@ebuchman ebuchman merged commit ec87c74 into develop Oct 31, 2017
@ebuchman ebuchman deleted the 243-restart-app-via-os branch October 31, 2017 20:27
cmwaters pushed a commit to cmwaters/tendermint that referenced this pull request Dec 12, 2022
Cashmaney pushed a commit to scrtlabs/tendermint that referenced this pull request Aug 2, 2023
…nt#794)

* Unsafe int cast in `kill` command (tendermint#783)

* Unsafe int cast in `kill` command

* Revert "Unsafe int cast in `kill` command"

This reverts commit bbd649bd372ca90f83dea7b424d67dafbd9eb541.

* Changed strategy

(cherry picked from commit 03c5e77)

# Conflicts:
#	cmd/cometbft/commands/debug/kill.go

* Revert "Unsafe int cast in `kill` command (tendermint#783)"

This reverts commit b7ab279a6df1f062bec60bcf95947d2a87f4ccec.

* Unsafe int cast in `kill` command (tendermint#783)

* Unsafe int cast in `kill` command

* Revert "Unsafe int cast in `kill` command"

This reverts commit bbd649bd372ca90f83dea7b424d67dafbd9eb541.

* Changed strategy

---------

Co-authored-by: Sergio Mena <sergio@informal.systems>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants