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:
Chris Lu committed 2026-10-22 02:27:05 -07:00
1 parent eeeda21a67
commit 8de67b6c38
1 file changed
+3
+3
View File
@@ -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)