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

controlapi: Allow removal of network when only dead tasks reference it #2018

Merged
merged 1 commit into from
Mar 9, 2017

Commits on Mar 8, 2017

  1. controlapi: Allow removal of network when only dead tasks reference it

    RemoveNetwork currently won't allow a network to be removed if any
    task in the store references it. This is a change relative to Docker
    1.12, where only services were checked.
    
    This might be a little heavy handed. Some tasks in the store may be long
    dead. Resource attachment tasks, in particular, must be detached by the
    API user, and this might be neglected after a failure.
    
    Change RemoveNetwork to only fail the network deletion if a task has
    actual and desired state of "running" or below. This means that neither
    a failed resource attachment task (whose desired state won't be
    adjusted) or a down node (where actual state won't reflect desired
    state) can block the network deletion.
    
    There may be some corner cases where deleting the network while a task
    is in the process of shutting down prevents the allocator from
    deallocating that task, but on balance this seems better than allowing
    many situations to block network deletion indefinitely.
    
    Signed-off-by: Aaron Lehmann <[email protected]>
    aaronlehmann committed Mar 8, 2017
    Configuration menu
    Copy the full SHA
    b00598c View commit details
    Browse the repository at this point in the history