Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix protocol handler retrieval thread CPU usage when no blocks are pr… #4617

Merged
merged 5 commits into from
Jan 9, 2024

Conversation

sydhds
Copy link
Contributor

@sydhds sydhds commented Jan 8, 2024

…ocessed

  • document all added functions
  • try in sandbox /simulation/labnet
    • if part of node-launch, checked using the resync_check flag
  • unit tests on the added/changed features
    • make tests compile
    • make tests pass
  • add logs allowing easy debugging in case the changes caused problems
  • if the API has changed, update the API specification

bilboquet
bilboquet previously approved these changes Jan 8, 2024
Copy link
Contributor

@bilboquet bilboquet left a comment

Choose a reason for hiding this comment

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

Solves the problem on my side.
Tracing the tokio loop from which this function is called shows that branches from the select are taken each second.

Copy link
Member

@damip damip left a comment

Choose a reason for hiding this comment

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

Nice catch !
TODO: fix comment, shorten all thread names to fit

@damip
Copy link
Member

damip commented Jan 8, 2024

@sydhds @bilboquet @AurelienFT Does this require an urgent 1.1 deployment ? or does it have no impact at genesis ?

Copy link

codecov bot commented Jan 8, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (4563909) 71.78% compared to head (13948e6) 71.78%.

Files Patch % Lines
massa-protocol-worker/src/connectivity.rs 50.00% 1 Missing ⚠️
...l-worker/src/handlers/block_handler/propagation.rs 50.00% 1 Missing ⚠️
...col-worker/src/handlers/block_handler/retrieval.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4617   +/-   ##
=======================================
  Coverage   71.78%   71.78%           
=======================================
  Files         291      291           
  Lines       51642    51642           
=======================================
  Hits        37069    37069           
  Misses      14573    14573           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AurelienFT
Copy link
Contributor

@sydhds @bilboquet @AurelienFT Does this require an urgent 1.1 deployment ? or does it have no impact at genesis ?

No it should stop when blocks will be produced. Could be cool to verify with a labnet

modship
modship previously approved these changes Jan 8, 2024
Signed-off-by: Jean-François <[email protected]>
@Floyz
Copy link

Floyz commented Jan 8, 2024

@sydhds @bilboquet @AurelienFT Does this require an urgent 1.1 deployment ? or does it have no impact at genesis ?

No it should stop when blocks will be produced. Could be cool to verify with a labnet

It has impact on node runners hardware tho, if you want people to have node running before genesis it would be great to publish a new release.
I stopped mine due to this bug, consuming one full CPU for nothing and impacting other services on a shared hardware. ( + CPU temp going high )

@sydhds sydhds dismissed stale reviews from modship and bilboquet via 5b64b08 January 8, 2024 14:29
massa-node/src/survey.rs Outdated Show resolved Hide resolved
@bilboquet
Copy link
Contributor

@sydhds @bilboquet @AurelienFT Does this require an urgent 1.1 deployment ? or does it have no impact at genesis ?

No it should stop when blocks will be produced. Could be cool to verify with a labnet

It has impact on node runners hardware tho, if you want people to have node running before genesis it would be great to publish a new release. I stopped mine due to this bug, consuming one full CPU for nothing and impacting other services on a shared hardware. ( + CPU temp going high )

Reproduced in sandbox.
Behavior is exactly the same as with mainnet (with or without the fix).

In labnet (thanks to @Leo-Besancon) the behavior is the one expected and stated above by @AurelienFT:

  • when blocks are produced, the load goes back to normal
  • the only corner case observed so far is: if there is only one node in the network that produces blocks, this node, and only it, will experience the bug.

Copy link
Member

@damip damip left a comment

Choose a reason for hiding this comment

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

Good !

@damip damip added this pull request to the merge queue Jan 9, 2024
Merged via the queue into main with commit 5697687 Jan 9, 2024
12 checks passed
@sydhds sydhds deleted the bug/pbh_retrieval_cpu_100 branch January 9, 2024 16:35
@Leo-Besancon Leo-Besancon linked an issue Jan 10, 2024 that may be closed by this pull request
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

100% core usage by protocol-block thread
6 participants