Skip to content

Commit

Permalink
GH-985 Better logging for interrupted apply_block trx
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Oct 31, 2024
1 parent d0ea755 commit 078781a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3813,7 +3813,7 @@ struct controller_impl {

if( transaction_failed && !transaction_can_fail) {
if (trace->except->code() == interrupt_exception::code_value) {
ilog("Interrupt of trx: ${t}", ("t", *trace));
ilog("Interrupt of trx id: ${id}", ("id", trace->id));
} else {
edump((*trace));
}
Expand Down Expand Up @@ -4370,7 +4370,15 @@ struct controller_impl {
log_irreversible();
transition_to_savanna_if_needed();
return controller::apply_blocks_result::complete;
} FC_LOG_AND_RETHROW( )
} catch (fc::exception& e) {
if (e.code() != interrupt_exception::code_value) {
wlog("${d}", ("d",e.to_detail_string()));
FC_RETHROW_EXCEPTION(e, warn, "rethrow");
}
throw;
} catch (...) {
try { throw; } FC_LOG_AND_RETHROW()
}
}

controller::apply_blocks_result maybe_apply_blocks( const forked_callback_t& forked_cb, const trx_meta_cache_lookup& trx_lookup )
Expand Down

0 comments on commit 078781a

Please sign in to comment.