Skip to content

Commit

Permalink
GH-447 On a failed produce block, wait until the next block
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jul 31, 2024
1 parent 505d835 commit 72ae6ee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,7 @@ producer_plugin_impl::start_block_result producer_plugin_impl::start_block() {
}
const auto& preprocess_deadline = _pending_block_deadline;

fc_dlog(_log, "Starting block #${n} at ${time} producer ${p}", ("n", pending_block_num)("time", now)("p", scheduled_producer.producer_name));
fc_dlog(_log, "Starting block #${n} ${bt} producer ${p}", ("n", pending_block_num)("bt", block_time)("p", scheduled_producer.producer_name));

try {

Expand Down Expand Up @@ -2648,6 +2648,13 @@ bool producer_plugin_impl::maybe_produce_block() {

fc_dlog(_log, "Aborting block due to produce_block error");
abort_block();
reschedule.cancel();

// block failed to produce, wait until the next block to try again
block_timestamp_type block_time = calculate_pending_block_time();
fc_dlog(_log, "Not starting block until ${bt}", ("bt", block_time));
schedule_delayed_production_loop(weak_from_this(), block_time);

return false;
}

Expand Down

0 comments on commit 72ae6ee

Please sign in to comment.