check the closing state on each batch during the purge.

This commit is contained in:
vyzo 2021-07-07 21:32:05 +03:00
parent c6421f8a75
commit fee50b13a2

View File

@ -1402,6 +1402,11 @@ func (s *SplitStore) purge(cids []cid.Cid) error {
func(cids []cid.Cid) error {
deadCids := deadCids[:0]
if atomic.LoadInt32(&s.closing) == 1 {
log.Info("splitstore is closing; aborting purge")
return xerrors.Errorf("compaction aborted")
}
s.txnLk.Lock()
defer s.txnLk.Unlock()