hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
438 stars 280 forks source link

fix(p2p): disable sending message when not ready to prevent busy loop #5032

Closed Erigara closed 1 month ago

Erigara commented 1 month ago

Context

It was observed that iroha consume a lot CPU in idle state, turned out it was due to accidental busy loop in p2p code.

Closes: #5033

Solution

Add conditional disabling sending message in Peer even loop when there is no data to be sent to prevent busy loop.