You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix docker hanging when container killed (elastic#3612)
No timeout was passed to the docker client. It seems in case of a killed container it can happen that the connection is hanging. To interrupt this connection, the timeout from the metricset is passed to the client. That means in case info for a container cannot be fetched, it will timeout.
This change requires that the docker module is not run with a timeout of 3s seconds, which indirectly means a period of 3s. The reason is that already the http request waits ~2s for the response. So if 1s is set as timeout, all requests will timeout.
Further changes:
* Containers without names will be ignored, as these are containers for which the data could not be fetched.
* Period was set to 1s by default instead of the period as document. This was changed.
* Add documentation node about minimal period.
Closeselastic#3610
The issue with this PR was introduce in 5.2.1 by fixing the memory leak. Before go routines just piled up, but now they caused filebeat to hang.
This needs also backport to 5.2.2
(cherry picked from commit 99f17d6)
// This is currently very inefficient as docker calculates the average for each request,
96
101
// means each request will take at least 2s: https://github.com/docker/docker/blob/master/cli/command/container/stats_helpers.go#L148
97
102
// Getting all stats at once is implemented here: https://github.com/docker/docker/pull/25361
98
-
funcexportContainerStats(client*docker.Client, container*docker.APIContainers) Stat {
103
+
funcexportContainerStats(client*docker.Client, container*docker.APIContainers, timeout time.Duration) Stat {
0 commit comments