mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-22 22:11:39 +02:00
filer: honor cancellation while collecting inode index entries
The recursive walk paged through every directory without ever checking the context, so a cancelled delete could keep listing indefinitely.
This commit is contained in:
1 parent
eeeda21a67
commit
8de67b6c38
1 file changed
+3
@@ -281,6 +281,9 @@ func (fsw *FilerStoreWrapper) collectInodeIndexEntriesRecursive(ctx context.Cont
|
||||
lastFileName := ""
|
||||
includeStartFile := false
|
||||
for {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
page := make([]*Entry, 0, PaginationSize)
|
||||
nextLastFileName, err := actualStore.ListDirectoryEntries(ctx, dirPath, lastFileName, includeStartFile, PaginationSize, func(entry *Entry) (bool, error) {
|
||||
page = append(page, entry)
|
||||
|
||||
Reference in new issue
Block a user