Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

Commit

Permalink
Adds container stat logging.
Browse files Browse the repository at this point in the history
Adds container stat logging before termininating container to help aid debugging
docker issue related to "unregister_netdevice: waiting for ...". See
moby/moby#5618 for more details.
  • Loading branch information
David Morhovich committed Sep 7, 2017
1 parent 98cbea9 commit 45822fc
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -115,6 +115,13 @@ public void stop() throws InterruptedException {
// Interrupt the thread blocking on waitContainer
stopAsync().awaitTerminated();

if (System.getenv("CONTAINER_STATS") != null) {
try {
log.info("container {} stats: {}", containerName, docker.stats(containerName));
} catch (DockerException e) {
log.warn("Could not log container stats. Exception was {}", e);
}
}
try {
docker.stopContainer(container, secondsToWaitBeforeKill);
} catch (DockerException e) {
Expand Down

0 comments on commit 45822fc

Please sign in to comment.