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

feat: recover aggregator on l1 sync failure #296

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,24 @@ func (a *Aggregator) handleRollbackBatches(rollbackData synchronizer.RollbackBat
// Start starts the aggregator
func (a *Aggregator) Start() error {
// Initial L1 Sync blocking
err := a.l1Syncr.Sync(true)
if err != nil {
a.logger.Fatalf("Failed to synchronize from L1: %v", err)
return err
for {
err := a.l1Syncr.Sync(true)
if err != nil {
a.logger.Errorf("Failed to synchronize from L1: %v", err)
continue
}
break
}

// Keep syncing L1
go func() {
err := a.l1Syncr.Sync(false)
if err != nil {
a.logger.Fatalf("Failed to synchronize from L1: %v", err)
for {
err := a.l1Syncr.Sync(false)
if err != nil {
a.logger.Errorf("Failed to synchronize from L1: %v", err)
time.Sleep(a.cfg.RetryTime.Duration)
continue
}
}
}()

Expand Down
Loading