Skip to content

Commit cd07a4e

Browse files
committed
get-batch: amend abandoned work-item cleanup (part two)
* replace WI `demand` flag with `owned` ownership gate * let asm() claim ownership before assembling and release it after cleanup * let abandoned-WI GC clean only unowned work items * store "WI abandonment" as an error; return it from asm() * check WI terminal state while waiting on Rx (not only between asm() iters) - add inline helper to return error(nil) * treat internal `errStopped` sentinel as quiet asm() termination --- * part two, prev. commit: 926bdbb Signed-off-by: Alex Aizman <alex.aizman@gmail.com>
1 parent e5d72a8 commit cd07a4e

3 files changed

Lines changed: 208 additions & 95 deletions

File tree

xact/xs/lso.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ const (
111111
)
112112

113113
var (
114-
errStopped = errors.New("stopped")
115-
ErrGone = errors.New("gone")
114+
errLsoStopped = errors.New("stopped")
115+
ErrGone = errors.New("gone")
116116
)
117117

118118
// interface guard
@@ -822,7 +822,7 @@ func (r *LsoXact) doWalk(msg *apc.LsoMsg) {
822822
}
823823
opts.WalkOpts.Bck.Copy(r.Bck().Bucket())
824824
if err := fs.WalkBck(opts); err != nil {
825-
if err != filepath.SkipDir && err != errStopped {
825+
if err != filepath.SkipDir && err != errLsoStopped {
826826
r.AddErr(err, 0)
827827
}
828828
}
@@ -878,7 +878,7 @@ func (r *LsoXact) cb(fqn string, de fs.DirEntry) error {
878878
select {
879879
case r.walk.pageCh <- entry:
880880
case <-r.walk.stopCh.Listen():
881-
return errStopped
881+
return errLsoStopped
882882
}
883883
return nil
884884
}
@@ -897,7 +897,7 @@ func (r *LsoXact) cb(fqn string, de fs.DirEntry) error {
897897
case r.walk.pageCh <- entry:
898898
/* do nothing */
899899
case <-r.walk.stopCh.Listen():
900-
return errStopped
900+
return errLsoStopped
901901
}
902902

903903
if !msg.IsFlagSet(apc.LsArchDir) {
@@ -927,7 +927,7 @@ func (r *LsoXact) cb(fqn string, de fs.DirEntry) error {
927927
case r.walk.pageCh <- e:
928928
/* do nothing */
929929
case <-r.walk.stopCh.Listen():
930-
return errStopped
930+
return errLsoStopped
931931
}
932932
}
933933
return nil

0 commit comments

Comments
 (0)