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

Backported exit on fork_db corrupted #311

Merged
merged 1 commit into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ struct controller_impl {
EOS_ASSERT( root_id == blog.head_id(), fork_database_exception, "fork database root does not match block log head" );
} else {
EOS_ASSERT( fork_db.root()->block_num == lib_num, fork_database_exception,
"empty block log expects the first appended block to build off a block that is not the fork database root" );
"empty block log expects the first appended block to build off a block that is not the fork database root. root block number: ${block_num}, lib: ${lib_num}", ("block_num", fork_db.root()->block_num) ("lib_num", lib_num) );
}

auto fork_head = (read_mode == db_read_mode::IRREVERSIBLE) ? fork_db.pending_head() : fork_db.head();
Expand Down
3 changes: 3 additions & 0 deletions plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin
chain_plugin::handle_bad_alloc();
} catch ( boost::interprocess::bad_alloc& ) {
chain_plugin::handle_db_exhaustion();
} catch ( const fork_database_exception& e ) {
elog("Cannot recover from ${e}. Shutting down.", ("e", e.to_detail_string()));
appbase::app().quit();
} catch( const fc::exception& e ) {
handle_error(e);
} catch (const std::exception& e) {
Expand Down