Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

[18.09 backport] Windows: DetachVhd attempt in cleanup #113

Merged
merged 1 commit into from
Nov 27, 2018

Commits on Nov 9, 2018

  1. Windows: DetachVhd attempt in cleanup

    Signed-off-by: John Howard <jhoward@microsoft.com>
    
    This is a fix for a few related scenarios where it's impossible to remove layers or containers
    until the host is rebooted. Generally (or at least easiest to repro) through a forced daemon kill
    while a container is running.
    
    Possibly slightly worse than that, as following a host reboot, the scratch layer would possibly be leaked and
    left on disk under the dataroot\windowsfilter directory after the container is removed.
    
    One such example of a failure:
    
    1. run a long running container with the --rm flag
    docker run --rm -d --name test microsoft/windowsservercore powershell sleep 30
    2. Force kill the daemon not allowing it to cleanup. Simulates a crash or a host power-cycle.
    3. (re-)Start daemon
    4. docker ps -a
    PS C:\control> docker ps -a
    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                PORTS               NAMES
    7aff773d782b        malloc              "powershell start-sl…"   11 seconds ago      Removal In Progress                       malloc
    5. Try to remove
    PS C:\control> docker rm 7aff
    Error response from daemon: container 7aff773d782bbf35d95095369ffcb170b7b8f0e6f8f65d5aff42abf61234855d: driver "windowsfilter" failed to remove root filesystem: rename C:\control\windowsfilter\7aff773d782bbf35d95095369ffcb170b7b8f0e6f8f65d5aff42abf61234855d C:\control\windowsfilter\7aff773d782bbf35d95095369ffcb170b7b8f0e6f8f65d5aff42abf61234855d-removing: Access is denied.
    PS C:\control>
    
    Step 5 fails.
    
    (cherry picked from commit efdad53)
    Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
    John Howard authored and thaJeztah committed Nov 9, 2018
    Configuration menu
    Copy the full SHA
    02fe718 View commit details
    Browse the repository at this point in the history