-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Conversation
…ted that is aborted.
@@ -1750,9 +1746,13 @@ void producer_plugin_impl::schedule_production_loop() { | |||
auto expect_time = chain.pending_block_time() - fc::microseconds(config::block_interval_us); | |||
// ship this block off up to 1 block time earlier or immediately | |||
if (fc::time_point::now() >= expect_time) { | |||
_timer.expires_from_now( boost::posix_time::microseconds( 0 )); | |||
fc_dlog(_log, "Scheduling Block Production on Exhausted Block #${num} immediately", | |||
// produce block immediately |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I cannot find a direct reason this is an issue, there are a few implicit requirements that this may one day run-afoul of that I think we should attempt to make more explicit
-
schedule_production_loop
is almost always called from a destructor of anfc::scoped_exit
which means it really shouldn't throw (maybe one day we should consider requiringnoexcept
qualifiers on lambdas forfc::scoped_exit). Right now,
maybe_produce_block` appears to handle all of the exceptions and is clean but I'd be interested in how we make sure the implicit requirement that it not throw is made explicit. -
maybe_produce_block
callsschedule_production_loop
making this recursive. I don't think it can get into an infinite recursion because this branch is taken based on time but, there are a lot of variables and if this stays direct, perhaps we should "schedule" the call toschedule_production_loop
inmaybe_produce_block
so that it at least clears the stack ?
at the least we should probably make the log messages the same (other than the notice about exhaustion) and turn the call and the fc_dlog
calls into a local lambda so that the messages are kept consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted this change as I think it is clearer and more consistent the way it was.
…h timer" This reverts commit d478d31.
…is one block interval too late.
…is one block interval too late.
… now is one block interval too late.
Change Description
Consensus Changes
API Changes
Documentation Additions