exit collect when we get EOF

Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
Upstream-commit: e03b55a2f5ce2c55699f0181350534a9e2034461
Component: engine
This commit is contained in:
Xianglin Gao
2016-12-29 13:38:30 +08:00
parent 23f7d46551
commit 6c28e79e35
@@ -155,11 +155,13 @@ func collect(ctx context.Context, s *formatter.ContainerStats, cli client.APICli
waitFirst.Done()
}
case err := <-u:
s.SetError(err)
if err == io.EOF {
break
}
if err != nil {
s.SetError(err)
continue
}
s.SetError(nil)
// if this is the first stat you get, release WaitGroup
if !getFirst {
getFirst = true