Skip to content

Do not allow removal of networks with attached tasks#1724

Closed
mavenugo wants to merge 1 commit intomoby:masterfrom
mavenugo:task-nw
Closed

Do not allow removal of networks with attached tasks#1724
mavenugo wants to merge 1 commit intomoby:masterfrom
mavenugo:task-nw

Conversation

@mavenugo
Copy link
Copy Markdown
Contributor

@mavenugo mavenugo commented Nov 1, 2016

added checks in control-api to prevent network with attached tasks from being removed.

Fixes #1692
But ideally this PR must go in alongside the fix for #440 as described in #1692 (comment)

Signed-off-by: Madhu Venugopal madhu@docker.com

 added checks in control-api to prevent network with attached
 tasks from being removed.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
@mavenugo
Copy link
Copy Markdown
Contributor Author

mavenugo commented Nov 1, 2016

ping @mrjana

@codecov-io
Copy link
Copy Markdown

Current coverage is 56.05% (diff: 36.36%)

Merging #1724 into master will increase coverage by 0.22%

@@             master      #1724   diff @@
==========================================
  Files            96         96          
  Lines         14902      14913    +11   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           8321       8360    +39   
+ Misses         5474       5445    -29   
- Partials       1107       1108     +1   

Sunburst

Powered by Codecov. Last update b693657...894d56c

return nil, grpc.Errorf(codes.Internal, "could not find tasks using network %s", request.NetworkID)
}

for _, t := range tasks {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds very expensive in a big cluster with 1 million containers (tasks).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrjana do you know of a better way to handle this ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dongluochen Yes it is very expensive but I am afraid there is no other simple way at this point since go-memdb cannot create an index which satisfies an OR of multiple fields in an object(or a field which is a slice and we need an index which satisfies each entry in the slice).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1728

@mavenugo
Copy link
Copy Markdown
Contributor Author

mavenugo commented Nov 2, 2016

#1728 took care of the changes. closing it.

@mavenugo mavenugo closed this Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block network removal with existing task-attachment (via --attachable)

6 participants