Skip to content

Commit

Permalink
fix lock release issue in stream sync (#4714)
Browse files Browse the repository at this point in the history
  • Loading branch information
GheisMohammadi authored Jul 19, 2024
1 parent a65cf71 commit 16fe018
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions api/service/stagedstreamsync/staged_stream_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ func (s *StagedStreamSync) cleanUp(ctx context.Context, fromStage int, db kv.RwD
continue
}
if err := s.pruneStage(ctx, firstCycle, s.pruningOrder[i], db, tx); err != nil {
utils.Logger().Error().Err(err).
Interface("stage id", s.pruningOrder[i].ID).
Msgf(WrapStagedSyncMsg("stage cleanup failed"))
panic(err)
}
}
Expand Down
4 changes: 2 additions & 2 deletions api/service/stagedstreamsync/state_sync_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ func (s *FullStateDownloadManager) cleanAccountTasks() {
return
}
// Sync wasn't finished previously, check for any task that can be finalized
for taskID, _ := range s.tasks.accountTasks {
for taskID := range s.tasks.accountTasks {
if s.tasks.accountTasks[taskID].done {
s.tasks.deleteAccountTask(taskID)
}
Expand Down Expand Up @@ -2333,7 +2333,7 @@ func (s *FullStateDownloadManager) onHealByteCodes(task *healTask,
Msg("Delivering set of healing bytecodes")

s.lock.Lock()
s.lock.Unlock()
defer s.lock.Unlock()

// Response is valid, but check if peer is signalling that it does not have
// the requested data. For bytecode range queries that means the peer is not
Expand Down

0 comments on commit 16fe018

Please sign in to comment.