-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simulation: Write logs on panic #2285
Conversation
sdk "github.com/cosmos/cosmos-sdk/types" | ||
dbm "github.com/tendermint/tendermint/libs/db" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linting was failing here, so I just ran make format.
Codecov Report
@@ Coverage Diff @@
## develop #2285 +/- ##
========================================
Coverage 63.87% 63.87%
========================================
Files 140 140
Lines 8682 8682
========================================
Hits 5546 5546
Misses 2756 2756
Partials 380 380 |
fmt.Printf("Exiting early due to SIGTERM, on block %d, operation %d\n", header.Height, opCount) | ||
DisplayEvents(events) | ||
os.Exit(128 + int(syscall.SIGTERM)) | ||
fmt.Printf("Exiting early due to SIGTERM/SIGINT, on block %d, operation %d\n", header.Height, opCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not:
sig := <-c
fmt.Printf("Exiting early due to %s, on block %d, operation %d\n", sig, header.Height, opCount)
DisplayEvents(events) | ||
os.Exit(128 + int(syscall.SIGTERM)) | ||
fmt.Printf("Exiting early due to SIGTERM/SIGINT, on block %d, operation %d\n", header.Height, opCount) | ||
simError = errors.New("Exited due to SIGTERM/SIGINT") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
Is this PR ready to go? Seems like this is necessary for debugging some of the bugs simulation uncovered. |
Yup this should be good to merge, pending review / approval. Anyone whose debugging can just directly use this branch for now though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
If the logs are large, it gets written to a file. Additionally, this PR also does a slight refactor so that simulation returns an error. This means when we do SIGTERM/ SIGINT the database cleanup code still gets ran.
Targeted PR against correct branch (see CONTRIBUTING.md)
Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: