skip not found error in case of race condition

This commit is contained in:
Chris Lu 2021-01-14 19:56:14 -08:00
parent d0826c2f62
commit 4aaa97c789
2 changed files with 6 additions and 0 deletions

View file

@ -171,6 +171,9 @@ func (store *UniversalRedisStore) ListDirectoryEntries(ctx context.Context, full
entry, err := store.FindEntry(ctx, path)
if err != nil {
glog.V(0).Infof("list %s : %v", path, err)
if err == filer_pb.ErrNotFound {
continue
}
} else {
if entry.TtlSec > 0 {
if entry.Attr.Crtime.Add(time.Duration(entry.TtlSec) * time.Second).Before(time.Now()) {

View file

@ -175,6 +175,9 @@ func (store *UniversalRedis2Store) ListDirectoryEntries(ctx context.Context, ful
entry, err := store.FindEntry(ctx, path)
if err != nil {
glog.V(0).Infof("list %s : %v", path, err)
if err == filer_pb.ErrNotFound {
continue
}
} else {
if entry.TtlSec > 0 {
if entry.Attr.Crtime.Add(time.Duration(entry.TtlSec) * time.Second).Before(time.Now()) {