Skip to content
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

Fix panic when a node stops while processing async network events #466

Closed
wants to merge 2 commits into from

Conversation

torao
Copy link
Contributor

@torao torao commented Sep 26, 2022

Description

This PR fixes the Issue Finschia/finschia-sdk#653.

In threads (go routines) that Reactor lanches ad-hoc, return an error instead of panic() when loading data from the BlockStore. Also, when store.BlockStore reports leveldb close as an error, it'll exit without doing anything if the calling Reactor has already stopped. The current LoadXxx() functions are not designed to return an error, so the scope of the fix is slightly larger.

This fix returns the error if the caller method using the BlockStore is capable of returning the error. Note, however, otherwise it will panic() as it does now.

@torao torao marked this pull request as draft October 3, 2022 08:06
@torao torao changed the title Fix panic when a node stops while processyn async network events Fix panic when a node stops while processing async network events Oct 4, 2022
@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Merging #466 (e4f2e9c) into main (1c1c7fb) will decrease coverage by 0.05%.
The diff coverage is 25.82%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #466      +/-   ##
==========================================
- Coverage   65.46%   65.40%   -0.06%     
==========================================
  Files         278      279       +1     
  Lines       37952    38107     +155     
==========================================
+ Hits        24844    24923      +79     
- Misses      11295    11361      +66     
- Partials     1813     1823      +10     
Impacted Files Coverage Δ
evidence/pool.go 69.03% <0.00%> (-0.40%) ⬇️
rpc/core/status.go 0.00% <0.00%> (ø)
rpc/core/tx.go 59.55% <0.00%> (-2.81%) ⬇️
state/services.go 16.66% <ø> (ø)
rpc/core/blocks.go 45.34% <5.00%> (-8.82%) ⬇️
consensus/reactor.go 73.21% <18.36%> (-1.37%) ⬇️
consensus/replay.go 69.06% <25.00%> (-2.17%) ⬇️
evidence/verify.go 75.57% <25.00%> (-3.28%) ⬇️
state/rollback.go 74.73% <25.00%> (-5.04%) ⬇️
consensus/state.go 73.74% <30.76%> (+0.06%) ⬆️
... and 25 more

@torao torao force-pushed the fix/leveldb-close-error branch 2 times, most recently from db776b3 to 74c48a9 Compare October 4, 2022 06:30
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale For github bot label Oct 15, 2022
@github-actions github-actions bot closed this Oct 19, 2022
@torao torao reopened this Oct 28, 2022
@torao torao removed the Stale For github bot label Oct 28, 2022
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale For github bot label Nov 8, 2022
@github-actions github-actions bot closed this Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale For github bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant