This repository was archived by the owner on Aug 2, 2022. It is now read-only.
Repository navigation
Move chainbase calls out of try-CATCH_AND_EXIT_DB_FAILURE block - #9674
Merged
Merged
Conversation
heifner
suggested changes
Nov 17, 2020
heifner
approved these changes
Nov 17, 2020
| namespace eosio { namespace chain { | ||
| combined_session::combined_session(chainbase::database& cb_database, eosio::session::undo_stack<rocks_db_type>* undo_stack) | ||
| : kv_undo_stack{ undo_stack } { | ||
| cb_session = std::make_unique<chainbase::database::session>(cb_database.start_undo_session(true)); |
Contributor
There was a problem hiding this comment.
Seems this would be better as a std::optional than a unique_ptr that way you avoid the dynamic memory alloc.
Contributor
Author
There was a problem hiding this comment.
Changing cb_session to "std::optionalchainbase::database::session cb_session" involves multiple changes in combined_database.cpp and combined_database.cpp. Is it OK not to do it at this time?
Contributor
Author
There was a problem hiding this comment.
Thanks Kevin for all your help and insist on getting best possible code!
heifner
approved these changes
Nov 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
In combined_database.cpp, when running with chainbase backing store, chainbase calls are outside the try-CATCH_AND_EXIT_DB_FAILUR,
while when running with rocksdb backing store, they are inside the try-CATCH_AND_EXIT_DB_FAILURE.
This PR makes exception handling consistent by moving the chainbase calls out of the try-CATCH_AND_EXIT_DB_FAILURE
when running with rocksdb backing store.
Change Type
Select ONE
Consensus Changes
API Changes
Documentation Additions