fdr/logplexc — pull request #1 by fdr (2013-11-01 18:40:25+00:00)
Title: Avoid some Goroutine leaks

Noticed when doing extended BenchmarkStartup testing.

The leaks fixed are all a variant of goroutines getting stuck on token
bucket manipulation, and so all these code paths have learned an
early-exit when the 'finalize' channel is closed.

After fixing the leaks, I noticed the asynchronicity of .Close() still
made testing the sum overhead of creation *and* destruction of a
Client value intractable, so .Close() has been made synchronous. This
backpressure seems like a good idea to avoid overwhelming the garbage
collector and goroutine scheduler, and someone can re-introduce
asynchronicity in the case where that seems better.

@deafbybeheading might find this interesting. It may relate to https://github.com/fdr/pg_logplexcollector/issues/1