-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
…rror logs for removed containers.
try { | ||
InspectContainerResponse containerInfo = dockerClient.inspectContainerCmd(containerId).exec(); | ||
running = containerInfo.getState().getRunning(); | ||
Optional<Container> container = dockerClient.listContainersCmd().exec() |
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.
we should avoid getting the data without filters. It has proven to fail in some environments with many containers
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...... do we even have to check here? Force removal should do the job anyway
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 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(); |
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.
Didn't it work? Maybe we can play with filter's format?
I'll close for now, pending finding a better way... |
...to reduce likelihood of docker-java error logs for removed containers. Should help with #342