fix(weed/filer/redis2): fix dropped error (#8952)

* fix(weed/filer/redis2): fix dropped error

* fix(weed/filer/redis2): break on non-ErrNotFound errors in ListDirectoryEntries

Without the break, a hard FindEntry error gets overwritten by subsequent
iterations and the function may return nil, silently losing the error.

---------

Co-authored-by: Chris Lu <chris.lu@gmail.com>
This commit is contained in:
Lars Lehtonen
2026-04-07 14:59:01 -07:00
committed by GitHub
parent fb0573ffc4
commit df619ec3f6

View File

@@ -197,15 +197,18 @@ func (store *UniversalRedis2Store) ListDirectoryEntries(ctx context.Context, dir
}
// fetch entry meta
var entry *filer.Entry
for _, fileName := range members {
path := util.NewFullPath(string(dirPath), fileName)
entry, err := store.FindEntry(ctx, path)
entry, err = store.FindEntry(ctx, path)
lastFileName = fileName
if err != nil {
glog.V(0).InfofCtx(ctx, "list %s : %v", path, err)
if err == filer_pb.ErrNotFound {
err = nil
continue
}
break
} else {
if entry.TtlSec > 0 {
if entry.Attr.Crtime.Add(time.Duration(entry.TtlSec) * time.Second).Before(time.Now()) {