Skip to content

Commit

Permalink
Looping on sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ineiti committed Feb 26, 2024
1 parent 5a677bb commit 8cb97c8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions core/ordering/cosipbft/cosipbft.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,16 @@ func NewServiceStart(s *Service) {
if err != nil {
panic("couldn't get roster of latest block: " + err.Error())
}
err = s.fsync.Sync(ctx, roster,
fastsync.Config{SplitMessageSize: DefaultFastSyncMessageSize})
if err != nil {
s.logger.Warn().Msgf("while syncing with other nodes: %+v", err)
// Loop to try to sync
for {
err := s.fsync.Sync(ctx, roster,
fastsync.Config{SplitMessageSize: DefaultFastSyncMessageSize})
if err == nil {
break
}
s.logger.Warn().Msgf("while syncing with other nodes - trying again in 10s: %+v",
err)
time.Sleep(10 * time.Second)
}
done()
}
Expand Down

0 comments on commit 8cb97c8

Please # to comment.