Log if not producing because of stale production#1385
Conversation
|
curiously when I tried this I got and then output ceased. What causes only 2 logs to be printed instead of continuing at each slot? |
Either no longer the producer for that slot or a recent block received. |
|
Just running |
This allows two messages before it stops because it is waiting for a block. Thanks for pointing this out. I believe the correct behavior here is to set |
| if (!_production_enabled) { | ||
| _pending_block_mode = pending_block_mode::speculating; | ||
| if (_producers.find(scheduled_producer.producer_name) != _producers.end()) { | ||
| fc_elog(_log, "Not producing block because stale production not enabled, block ${t}", ("t", block_time)); |
There was a problem hiding this comment.
Do you want to log the producer name?
There was a problem hiding this comment.
I thought about it, but none of the other Not producing block because log statements log the producer. I didn't want to change any of the existing ones and just kept this consistent. Under normal operation the BP should know their one and only one producer name.
Add a log of
Not producing block because stale production not enabledwhich was the only cases that didn't already log when a node would produce but doesn't for some reason. Noticed this on a recent test failure when looking at the logs.Also sets the flag that prevents the
producer_pluginfrom going into an infinite wait for a block. Since you are a configured producer you should keep trying to produce.