sapling/tests/test-patchrmdir.py.out
Jun Wu ca4723ad22 patchrmdir: new extension to workaround rmdir kernel issues
Summary:
We have encountered a kernel issue where `rmdir` a non-empty directory may race
with other things and hang in kernel for a long time.

This patch changes `os.rmdir` to avoid `rmdir` non-empty directories. It is
written in Cython calling the low-level `readdir` libc friends to make overhead
minimal.

Test Plan: Added a new test

Reviewers: #sourcecontrol, clm, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, simpkins, osandov, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4716711

Tasks: 16647532

Signature: t1:4716711:1489627923:7c7432748c1fd8c070ce257bd172feebd3807f65
2017-03-15 18:55:48 -07:00

15 lines
356 B
Plaintext

rmdir d1 - should fail with ENOTEMPTY
error: Non-empty directory
rmdir d1/d2 - should succeed
success
rmdir d1 - should fail with ENOTEMPTY
error: Non-empty directory
rmdir d1 - should succeed
success
rmdir d1 - should fail with ENOENT
error: *
removedirs d2 (and d1) - should succeed
success
removedirs d1 - should fail with ENOENT
error: *