Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition on error returned after context cancellation (#12743)
After #11981 docker client watching event uses the context provided by the metricset wrapper. This produces a race condition on error reporting: the errors channel will receive a context cancelled error when the context is done, so both paths can be chosen by the select. If the errors one is chosen, an error will be reported and a reconnect will be attempted, that will fail. Alternativelly we could have created another context and cancel it after the reporter is done, in a similar fashion to what was done before #11981, but then we would be breaking the chain of derived contexts.
- Loading branch information