-
Notifications
You must be signed in to change notification settings - Fork 881
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
Ensuring endpoint resources are freed even on delete failures #1853
base: master
Are you sure you want to change the base?
Conversation
LGTM |
endpoint.go
Outdated
@@ -833,6 +833,12 @@ func (ep *endpoint) Delete(force bool) error { | |||
logrus.Warnf("failed to recreate endpoint in store %s : %v", name, e) | |||
} | |||
} | |||
|
|||
ep.releaseAddress() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current code makes sure that the resources are not freed up if deleteEndpoint fails.
I think the better fix is to make sandbox Delete() to call sb.delete(true), which will forcefully remove the endpoint.
@mavenugo @abhinandanpb is this ready to go in? |
Considering that now the |
@fcrisciani I agree we should still log the error even on force. |
6950c76
to
745cc37
Compare
@@ -220,13 +220,11 @@ func (sb *sandbox) delete(force bool) error { | |||
continue | |||
} | |||
|
|||
if !force { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering, this was never done then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be done during delete sandbox.
On the the contrary this would have been skipped during sandboxCleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually we should be skipping this by default now. Let me check this again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @abhi did you check on this?
Came across a code path where we might not be releasing ip address assigned to an endpoint if we have a failure with deleteEndpoint. Even if there is a failure it is better to release the resource rather than holding them. This might lead to issues where ip never gets released even though the container has exited and the only way of recovery is a reload. Signed-off-by: Abhinandan Prativadi <[email protected]>
Came across a code path where we might not be releasing ip
address assigned to an endpoint if we have a failure with
deleteEndpoint. Even if there is a failure it is better to
release the resource rather than holding them. This might
lead to issues where ip never gets released even though
the container has exited and the only way of recovery is a
reload.
Signed-off-by: Abhinandan Prativadi [email protected]