Skip to content

Commit

Permalink
Merge pull request #1525 from 0chain/hotfix/delete-race
Browse files Browse the repository at this point in the history
fix race condition in process delete
  • Loading branch information
dabasov authored Jun 13, 2024
2 parents d7bac27 + 0423cf0 commit 0afd9fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions zboxcore/sdk/commitworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ func (req *CommitRequest) commitBlobber(
wm.PreviousAllocationRoot = ""
}
if wm.AllocationRoot == wm.PreviousAllocationRoot {
l.Logger.Error("Allocation root and previous allocation root are same")
return thrown.New("commit_error", "Allocation root and previous allocation root are same")
l.Logger.Debug("Allocation root and previous allocation root are same")
return nil
}
wm.ChainHash = chainHash
wm.FileMetaRoot = rootRef.FileMetaHash
Expand Down
2 changes: 1 addition & 1 deletion zboxcore/sdk/deleteworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func (dop *DeleteOperation) Process(allocObj *Allocation, connectionID string) (
deleteReq.wg.Add(1)
go func(blobberIdx int) {
defer deleteReq.wg.Done()
refEntity, err := deleteReq.getObjectTreeFromBlobber(pos)
refEntity, err := deleteReq.getObjectTreeFromBlobber(uint64(blobberIdx))
if errors.Is(err, constants.ErrNotFound) {
deleteReq.consensus.Done()
return
Expand Down

0 comments on commit 0afd9fd

Please sign in to comment.