-
Notifications
You must be signed in to change notification settings - Fork 712
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
probe: Stats gathering can be started twice #1799
Comments
I was wondering whether we could simply do everything up to setting |
That might have further impact, since it seems to be doing potentially long things like making http requests. I don't know the full context of this code. |
Hence "I was wondering whether we could" rather than "We should" :) |
Ah, on closer inspection, it sets up and makes a new connection, but then pushes data over it long-term. So you'd still block for the duration of |
I think we should try using the |
...instead of rolling our own. This also fixes #1799 - a race condition that could result in multiple stats gatherers for a container.
...instead of rolling our own. This also fixes #1799 - a race condition that could result in multiple stats gatherers for a container.
...instead of rolling our own. This also fixes #1799 - a race condition that could result in multiple stats gatherers for a container.
use go-dockerclient's Client.Stats Fixes #1799
In
probe/docker/container.go
,StartGatheringStats()
, we check ifc.statsConn
is set and only start a new stats connection if it is not. However, we do not immediately then set this value (that happens only after some other setup inside a goroutine we then launch), meaning it might not be set by the time we get called again.In this case, we would have two connections reporting stats for the same probe.
The simplest fix would be to add a
statsStarted bool
to the struct, and do:perhaps modulo some nicer handling of the Unlock
The text was updated successfully, but these errors were encountered: