Skip to content

Conversation

@heifner
Copy link
Contributor

@heifner heifner commented Apr 16, 2025

Add a log of Not producing block because stale production not enabled which 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_plugin from going into an infinite wait for a block. Since you are a configured producer you should keep trying to produce.

@heifner heifner requested review from greg7mdp and linh2931 April 16, 2025 16:41
@heifner heifner added the OCI Work exclusive to OCI team label Apr 16, 2025
@heifner heifner added this to the Spring v1.2.0-rc1 milestone Apr 16, 2025
@spoonincode
Copy link
Contributor

curiously when I tried this I got

error 2025-04-16T21:10:57.938 nodeos    producer_plugin.cpp:2063      determine_pending_bl ] Not producing block because stale production not enabled, block 2025-04-16T21:10:58.000
error 2025-04-16T21:10:58.438 nodeos    producer_plugin.cpp:2063      determine_pending_bl ] Not producing block because stale production not enabled, block 2025-04-16T21:10:58.500

and then output ceased. What causes only 2 logs to be printed instead of continuing at each slot?

@heifner
Copy link
Contributor Author

heifner commented Apr 16, 2025

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.

@spoonincode
Copy link
Contributor

Just running nodeos -peosio --delete-all gives me only 2 logs

@heifner
Copy link
Contributor Author

heifner commented Apr 16, 2025

Just running nodeos -peosio --delete-all gives me only 2 logs

https://github.com/AntelopeIO/spring/blob/main/plugins/producer_plugin/producer_plugin.cpp#L2116-L2125

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 not_producing_when_time = true in this case. Then you repeatably get the error message for each block.

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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to log the producer name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@heifner heifner merged commit 924e839 into main Apr 18, 2025
36 checks passed
@heifner heifner deleted the not-producing-log branch April 18, 2025 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCI Work exclusive to OCI team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants