fixup! operations: fix hang when deleting files and a fatal error occurs

x
This commit is contained in:
Nick Craig-Wood committed 2026-09-20 12:17:32 +01:00
1 parent b40d72332b
commit 9dc8422a22
1 file changed
+2 -4
+2 -4
View File
@@ -607,11 +607,9 @@ func DeleteFilesWithBackupDir(ctx context.Context, toBeDeleted fs.ObjectsChan, b
for range ci.Checkers {
go func() {
defer wg.Done()
// Every object must be received, even after a fatal error,
// otherwise the sender blocks when the channel fills up
for dst := range toBeDeleted {
// Empty the channel on fatal error
if fatalErrorCount.Load() != 0 {
continue
}
err := DeleteFileWithBackupDir(ctx, dst, backupDir)
if err != nil {
errorCount.Add(1)