mozilla-services/heka — pull request #526 by crankycoder (2013-11-18 20:39:29+00:00)
Title: CommandChain and ManagedCmd fixes to prevent goroutine leakage

This is part of #505 and should prevent any goroutines from leaking in the ProcessInput code.

* invoke drainChannels prior to exiting from ManagedCmd::Wait()
* ManagedCmd timeout is just a special case of Stopping now to prevent goroutine leaks
* CommandChain was leaking goroutines on subcommand error. Chains now
report a single aggregate error to prevent goroutine leaks.