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

Improve hack on StopService function to force removing the container #526

Merged
merged 3 commits into from
Oct 5, 2018

Conversation

NicolasMahe
Copy link
Member

@NicolasMahe NicolasMahe commented Oct 5, 2018

Ready to merge

@NicolasMahe NicolasMahe changed the title [WIP] Improve hack on StopService function to force removing the container Improve hack on StopService function to force removing the container Oct 5, 2018
return err
}
c.client.ContainerStop(ctx, container.ID, &timeout)
c.client.ContainerRemove(ctx, container.ID, types.ContainerRemoveOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, we should enable Force option within ContainerRemoveOptions in case container is not properly stopped. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

The force option is quite risky... because we don't know the kind of services that are running I would definitely avoid this solution as much as possible. This might corrupt the service.

Copy link
Member Author

Choose a reason for hiding this comment

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

The timeout parameter in the containerStop function allow the container to stop gracefully before being killed.
So we already have this mechanism.

@antho1404 antho1404 merged commit 8e98a70 into dev Oct 5, 2018
@antho1404 antho1404 deleted the fix/stop-service branch October 5, 2018 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants