From ba7a7f11bd517c340674520643cf1a5d874e210b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 15:38:40 +0100 Subject: [PATCH] add peer gossip sleep (#241) (#245) * add peer gossip sleep * add changelog * Update .changelog/unreleased/bug-fixes/4-busy-loop-send-block-part.md Co-authored-by: Jasmina Malicevic * Update .changelog/unreleased/bug-fixes/4-busy-loop-send-block-part.md --------- Co-authored-by: jhernandezb Co-authored-by: Jasmina Malicevic (cherry picked from commit 5954e7552a9106f76475090417a026b563efb9b6) Co-authored-by: Sergio Mena --- .changelog/unreleased/bug-fixes/4-busy-loop-send-block-part.md | 2 ++ consensus/reactor.go | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 .changelog/unreleased/bug-fixes/4-busy-loop-send-block-part.md diff --git a/.changelog/unreleased/bug-fixes/4-busy-loop-send-block-part.md b/.changelog/unreleased/bug-fixes/4-busy-loop-send-block-part.md new file mode 100644 index 0000000000..59bda2afc3 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/4-busy-loop-send-block-part.md @@ -0,0 +1,2 @@ +- `[consensus]` Fixed a busy loop that happened when sending of a block part failed by sleeping in case of error. + ([\#4](https://github.com/informalsystems/tendermint/pull/4)) \ No newline at end of file diff --git a/consensus/reactor.go b/consensus/reactor.go index 917949ed84..4310cb7046 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -706,6 +706,8 @@ func (conR *Reactor) gossipDataForCatchup(logger log.Logger, rs *cstypes.RoundSt ps.SetHasProposalBlockPart(prs.Height, prs.Round, index) } else { logger.Debug("Sending block part for catchup failed") + // sleep to avoid retrying too fast + time.Sleep(conR.conS.config.PeerGossipSleepDuration) } return }