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

WIP: Tidy up container teardown code #358

Closed
wants to merge 1 commit into from
Closed

WIP: Tidy up container teardown code #358

wants to merge 1 commit into from

Conversation

rnorth
Copy link
Member

@rnorth rnorth commented Jun 5, 2017

...to reduce likelihood of docker-java error logs for removed containers. Should help with #342

try {
InspectContainerResponse containerInfo = dockerClient.inspectContainerCmd(containerId).exec();
running = containerInfo.getState().getRunning();
Optional<Container> container = dockerClient.listContainersCmd().exec()
Copy link
Member

Choose a reason for hiding this comment

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

we should avoid getting the data without filters. It has proven to fail in some environments with many containers

Copy link
Member

Choose a reason for hiding this comment

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

actually...... do we even have to check here? Force removal should do the job anyway

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 thing I'm trying to avoid is docker-java dumping loud error logs if it tries to remove a container that doesn't exist. The name filter also seems to be responsible for this other error message which we see a lot:

20:35:52.348 ERROR com.github.dockerjava.core.async.ResultCallbackTemplate - Error during callback
com.github.dockerjava.api.exception.InternalServerErrorException: {"message":"invalid character '%' looking for beginning of value"}

I can't remember the exact condition that leads to it (even though it was only a week ago!) but found that the name filters can't be relied upon to work cleanly.

}

private void removeNetwork(String networkName) {
List<Network> networks;
try {
networks = dockerClient.listNetworksCmd().withNameFilter(networkName).exec();
Copy link
Member

Choose a reason for hiding this comment

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

Didn't it work? Maybe we can play with filter's format?

@bsideup bsideup added this to the 1.3.1 milestone Jun 10, 2017
@rnorth
Copy link
Member Author

rnorth commented Jun 11, 2017

I'll close for now, pending finding a better way...

@rnorth rnorth closed this Jun 11, 2017
@rnorth rnorth deleted the tidy-cleanup branch October 8, 2018 16:39
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.

2 participants