#2699 Fix race handling in rmtree
Merged by tkopecek. Opened by mikem.
mikem/koji rmtree-updates  into  master

Download 2699.patch

Fixes https://pagure.io/koji/issue/2698

Despite previous work on rmtree to mitigate race conditions, there are still cases where it fails.

This PR cleans up the code a bit, adds some clearer comments on the trickier bits, and expands the unit tests to cover some race conditions.

Previous work on rmtree:

  • pr #2527
  • pr #2518
  • pr #2399

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

It would be good if testing could include an nfs filesystem

I believe that nfs is likely required to replicate #2698. On local filesystems, calls to os.listdir('.') and os.chdir('..') appear to always succeed even when the directory is deleted out from under us. However, with nfs we'll see ESTALE errors

Commit 131c5fa1 fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata Update from @tkopecek:
- Pull-request untagged with: testing-ready
- Pull-request tagged with: no_qe

Metadata