fix: correct RemoveWithRetry error handling (#39619) (#39626)

Backport #39619 by @wxiaoguang

* Fix #39618
* Follow up #38588
* Remove unrelated errors

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabotandwxiaoguang authored and GitHub committed 2026-10-06 09:36:06 +00:00
1 parent 30cc41ff97
commit 15a0ea83ca
2 files changed
+7 -3

No files matched your search

+1 -1
View File
@@ -119,7 +119,7 @@ func (l *LocalStorage) Stat(path string) (os.FileInfo, error) {
func (l *LocalStorage) deleteEmptyParentDirs(localFullPath string) {
for parent := filepath.Dir(localFullPath); len(parent) > len(l.dir); parent = filepath.Dir(parent) {
if err := util.RemoveWithRetry(parent); err != nil && !os.IsNotExist(err) {
if err := os.Remove(parent); err != nil && !os.IsNotExist(err) {
// since the target file has been deleted, parent dir error is not related to the file deletion itself.
break
}