Skip to content

Commit

Permalink
Merge pull request #1539 from 0chain/fix/status-error
Browse files Browse the repository at this point in the history
call status error callback
  • Loading branch information
dabasov authored Jun 21, 2024
2 parents a4c103a + b19fa83 commit 279a3b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion zboxcore/sdk/multi_operation_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ func (mo *MultiOperation) Process() error {
swg.Wait()

if ctx.Err() != nil {
return context.Cause(ctx)
err := context.Cause(ctx)
return err
}

// Check consensus
Expand Down
8 changes: 4 additions & 4 deletions zboxcore/sdk/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func (a *Allocation) CheckAllocStatus() (AllocStatus, []BlobberStatus, error) {
}
wg.Wait()
close(markerChan)
if a.ParityShards > 0 && errCnt > int32(a.ParityShards) {
if (a.ParityShards > 0 && errCnt > int32(a.ParityShards)) || (a.ParityShards == 0 && errCnt > 0) {
return Broken, blobberRes, common.NewError("check_alloc_status_failed", markerError.Error())
}

Expand Down Expand Up @@ -328,12 +328,12 @@ func (a *Allocation) CheckAllocStatus() (AllocStatus, []BlobberStatus, error) {
versionMap[version] = append(versionMap[version], rb)
}

if len(versionMap) < 2 {
req := a.DataShards

if len(versionMap) == 0 {
return Commit, blobberRes, nil
}

req := a.DataShards

if len(versionMap[latestVersion]) > req || len(versionMap[prevVersion]) > req {
return Commit, blobberRes, nil
}
Expand Down

0 comments on commit 279a3b3

Please sign in to comment.