Skip to content
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

Docker input plugin should use context.WithTimeout #1133

Closed
StephanZaat opened this issue May 1, 2016 · 5 comments · Fixed by #1135
Closed

Docker input plugin should use context.WithTimeout #1133

StephanZaat opened this issue May 1, 2016 · 5 comments · Fixed by #1135

Comments

@StephanZaat
Copy link

I have around 15 dockers on a single server, so I'd prefer to use [ ] to get the status from all dockers.
However, when a docker on one of our test servers is in status "restarting" (i.e. for some reason it is not starting) Telegraf will hang on this docker and will refuse to send any output to the influx server.

I would expect Telegraf just skips a non-functioning docker. We have consul and other tools to do service discovery and checking.

@zstyblik
Copy link
Contributor

zstyblik commented May 1, 2016

@StephanZaat which version of Telegraf do you use?

@StephanZaat
Copy link
Author

Telegraf - Version 0.12.1

@zstyblik
Copy link
Contributor

zstyblik commented May 1, 2016

This can be fixed by using any other context than context.Background() as context.Background() doesn't have any timeout. Beware, though. Metric-wise, if Docker Daemon doesn't want to talk with you or is busy, it won't talk with you. This will lead to timeouts and "gaps" in metrics. But it seems this is the reality.

@sparrc
Copy link
Contributor

sparrc commented May 1, 2016

good point @zstyblik, I've changed the issue to reflect that. We should be using context.WithTimeout.

@sparrc sparrc changed the title Docker input plugin hangs when docker is in status: "Restarting" Docker input plugin should use context.WithTimeout May 1, 2016
@sparrc
Copy link
Contributor

sparrc commented May 1, 2016

here are the instances:

docker.go
100:    containers, err := d.client.ContainerList(context.Background(), opts)
130:    info, err := d.client.Info(context.Background())
213:    r, err := d.client.ContainerStats(context.Background(), container.ID, false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants