Skip to content

When a "directory not empty" error occurs while EnsureRemoveAll operation should be retried once.#52172

Open
Wang-squirrel wants to merge 1 commit intomoby:masterfrom
Wang-squirrel:dev_1
Open

When a "directory not empty" error occurs while EnsureRemoveAll operation should be retried once.#52172
Wang-squirrel wants to merge 1 commit intomoby:masterfrom
Wang-squirrel:dev_1

Conversation

@Wang-squirrel
Copy link

@Wang-squirrel Wang-squirrel commented Mar 13, 2026

when
fix: #52161
- What I did
I observed that the EnsureRemoveAll function is returning a "directory not empty" error upon execution — this behavior is unexpected and should not occur.

- How I did it
We should retry the os.RemoveAll operation if an ENOTEMPTY error is encountered.
- How to verify it
check code
- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@github-actions github-actions bot added the area/daemon Core Engine label Mar 13, 2026
@thaJeztah
Copy link
Member

Thank you for contributing! It appears your commit message is missing a DCO sign-off,
causing the DCO check to fail.

We require all commit messages to have a Signed-off-by line with your name
and e-mail (see "Sign your work"
in the CONTRIBUTING.md in this repository), which looks something like:

Signed-off-by: YourFirsName YourLastName <yourname@example.org>

There is no need to open a new pull request, but to fix this (and make CI pass),
you need to amend the commit(s) in this pull request, and "force push" the amended
commit.

Unfortunately, it's not possible to do so through GitHub's web UI, so this needs
to be done through the git commandline.

You can find some instructions in the output of the DCO check (which can be found
in the "checks" tab on this pull request), as well as in the Moby contributing guide.

Steps to do so "roughly" come down to:

  1. Set your name and e-mail in git's configuration:

    git config --global user.name "YourFirstName YourLastName"
    git config --global user.email "yourname@example.org"

    (Make sure to use your real name (not your GitHub username/handle) and e-mail)

  2. Clone your fork locally

  3. Check out the branch associated with this pull request

  4. Sign-off and amend the existing commit(s)

    git commit --amend --no-edit --signoff

    If your pull request contains multiple commits, either squash the commits (if
    needed) or sign-off each individual commit.

  5. Force push your branch to GitHub (using the --force or --force-with-lease flags) to update the pull request.

let me know if you need help or more detailed instructions!

…y deletion

Signed-off-by: wang.xiaosong <wang.xiaosong1@zte.com.cn>
@Wang-squirrel
Copy link
Author

@thaJeztah sign-off has been added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Core Engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker run --rm will failed because directory /var/lib/docker/containers/$container_id is not empty when remove it

2 participants