Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.1] runc list: fix race with runc delete #4231

Merged
merged 2 commits into from
May 17, 2024

Commits on May 10, 2024

  1. list: getContainers: less indentation

    Instead of a huge if {} block, use continue.
    
    Best reviewed with --ignore-all-space.
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    (cherry picked from commit 095929b)
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed May 10, 2024
    Configuration menu
    Copy the full SHA
    09214f2 View commit details
    Browse the repository at this point in the history
  2. list: use Info(), fix race with delete

    Since commit 5516294 we can (and should) use Info() to get access to
    file stat. Do this.
    
    While going over directory entries, a parallel runc delete can remove
    an entry, and with the current code it results in a fatal error (which
    was not observed in practice, but looks quite possible). To fix,
    add a special case to continue on ErrNotExist.
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    (cherry picked from commit 1a3ee49)
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed May 10, 2024
    Configuration menu
    Copy the full SHA
    986edbe View commit details
    Browse the repository at this point in the history