spotify/helios — pull request #297 by drewcsillag (2014-11-14 18:40:06+00:00)
Title: docker client pool leak mitigation

Create and tear down the client at each usage.

Back Story: we've seen issues where excessive communication with the docker daemon has left the agent in a stuck state. Upon investigation, it appears that threads are stuck attempting to get connections from the connection pool in the docker client. We dug in some more and cannot figure out why, given the circumstances we see, how the pool would be exhausted. So to avoid the whole thing, we just create clients when we need them, and dispose of them right away.