Skip to content

Return an empty stats if the container is restarting#28026

Merged
vdemeester merged 1 commit intomoby:masterfrom
boaz0:fix_27772
Nov 20, 2016
Merged

Return an empty stats if the container is restarting#28026
vdemeester merged 1 commit intomoby:masterfrom
boaz0:fix_27772

Conversation

@boaz0
Copy link
Contributor

@boaz0 boaz0 commented Nov 3, 2016

- What I did
Send an empty stats if a container is restarting to avoid suspended docker-stats.
Closes #27772

- How I did it
In case stream is 0 and the given container is restarting the daemon returns an empty stats.

- How to verify it

$ docker run --restart always ubuntu true
$ docker stats --no-stream
CONTAINER           CPU %               MEM USAGE / LIMIT   MEM %               NET I/O             BLOCK I/O           PIDS
61d2e2e3fbb3        0.00%               0 B / 0 B           0.00%               0 B / 0 B           0 B / 0 B           0

In case, a container is restarting indefinitely running
"docker stats --no-stream <restarting_container>" is suspended.

To fix this, the daemon makes sure the container is either not
running or restarting if `--no-stream` is set to true and if so
returns an empty stats.

Should fix #27772.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
@vieux
Copy link
Contributor

vieux commented Nov 19, 2016

ping @crosbymichael

@vieux
Copy link
Contributor

vieux commented Nov 19, 2016

LGTM

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐸

@vdemeester vdemeester merged commit baa14c0 into moby:master Nov 20, 2016
@vieux vieux mentioned this pull request Dec 5, 2016
liusdu pushed a commit to liusdu/moby that referenced this pull request Oct 30, 2017
In case, a container is restarting indefinitely running
"docker stats --no-stream <restarting_container>" is suspended.

To fix this, the daemon makes sure the container is either not
running or restarting if `--no-stream` is set to true and if so
returns an empty stats.

Should fix moby#27772.

fix DTS2017062812251
backport from moby#28026 without conflicts.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Signed-off-by: Yuanhong Peng <pengyuanhong@huawei.com>
liusdu pushed a commit to liusdu/moby that referenced this pull request Oct 30, 2017
…wei-1.11.2'


Return an empty stats if the container is restarting

In case, a container is restarting indefinitely running
"docker stats --no-stream <restarting_container>" is suspended.

To fix this, the daemon makes sure the container is either not
running or restarting if `--no-stream` is set to true and if so
returns an empty stats.

Should fix moby#27772.

fix DTS2017062812251
backport from moby#28026 without conflicts.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Signed-off-by: Yuanhong Peng <pengyuanhong@huawei.com>



See merge request docker/docker!612
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants