tkopecek / koji

Forked from koji 7 years ago
Clone

52a63f7 util: [rmtree] try best to catch errors for race condition

2 files Authored by julian8628 3 years ago, Committed by tkopecek 3 years ago,
    util: [rmtree] try best to catch errors for race condition
    
    fixes: #2481
    
    This approach is ugly, but just working.
    
    ENOENT and ESTALE errors are catched in `chdir`, `listdir` calls to stomach the deletion by other process/thread
    
    ENOTEMPTY is catched when calling `os.rmdir(path)` in `rmtree()` too. It happens when `path` is on an NFS like where ESTALE happens.
    
        
file modified
+63 -14
file modified
+4 -4