mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
ca4723ad22
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
15 lines
356 B
Plaintext
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: *
|