Skip to content

Commit

Permalink
Merge pull request #10857 from filecoin-project/asr/feat-deadlock-2
Browse files Browse the repository at this point in the history
fix: splitstore: remove deadlock around waiting for sync
  • Loading branch information
arajasek authored May 11, 2023
2 parents b4ea0db + f4a3207 commit a0ebd8b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions blockstore/splitstore/splitstore_compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -1114,13 +1114,17 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp
if err := walkBlock(c); err != nil {
return xerrors.Errorf("error walking block (cid: %s): %w", c, err)
}

if err := s.checkYield(); err != nil {
return xerrors.Errorf("check yield: %w", err)
}
}
return nil
})
}

if err := g.Wait(); err != nil {
return err
return xerrors.Errorf("walkBlock workers errored: %w", err)
}
}

Expand Down Expand Up @@ -1153,8 +1157,8 @@ func (s *SplitStore) walkObject(c cid.Cid, visitor ObjectVisitor, f func(cid.Cid
}

// check this before recursing
if err := s.checkYield(); err != nil {
return 0, err
if err := s.checkClosing(); err != nil {
return 0, xerrors.Errorf("check closing: %w", err)
}

var links []cid.Cid
Expand Down Expand Up @@ -1222,8 +1226,8 @@ func (s *SplitStore) walkObjectIncomplete(c cid.Cid, visitor ObjectVisitor, f, m
}

// check this before recursing
if err := s.checkYield(); err != nil {
return sz, err
if err := s.checkClosing(); err != nil {
return sz, xerrors.Errorf("check closing: %w", err)
}

var links []cid.Cid
Expand Down

0 comments on commit a0ebd8b

Please sign in to comment.