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

Always purge stopped containers #3148

Merged
merged 1 commit into from
Sep 6, 2017
Merged

Conversation

clinta
Copy link
Contributor

@clinta clinta commented Aug 31, 2017

Old containers should always be purged, even if they exited successfully. Because the logging socket is closed when the container exits, if the same container is restarted, instead of a new one being created it is unable to start because it cannot connect to the old logging socket.

@dadgar
Copy link
Contributor

dadgar commented Sep 1, 2017

@clinta The if statement you changed is checking if the container is running or starting. Not whether it is dead. We purge all of the containers that have the same name if they are dead.

@clinta
Copy link
Contributor Author

clinta commented Sep 5, 2017

The check does not work as intended. A State.FinishedAt value of zero does not imply the container is starting. If a container fails to start, and is retried, State.FinishedAt will still be zero, but the container is not running or starting. As a result, any subsequent retry fails due to the container configuration pointing to an invalid logging socket.

A container inspect on a starting container will hang indefinitely, so there is no return value that represents a starting container. When a container is starting, that containers mutex is locked preventing the call to inspect from returning until it has a valid state of running or dead.

@dadgar dadgar merged commit d8d4fb8 into hashicorp:master Sep 6, 2017
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants