zenoss/zenoss.metric.consumer — pull request #40 by morr-zenoss (2014-06-11 22:57:32+00:00)
Title: Feature/zen 11665

Fix for ZEN-11665: Europa - MetricConsumer should be able to connect to tsdb after it is restarted.

There are two main parts to the fix:
A) In OpenTsdbMetricService.push(): Added code to send a DATA_RECEIVED event, even if inflight number is nonzero - when openTSDB went down, the queue was not being polled, even though there were inflight requests. sendiing the event makes sure that happens.
B) In OpenTsdbWriter.processBatch(), there was code to add the clientid tag back to the metric after publishing to openTSDB. In the event of an exception, it was not getting re-added, which caused a later exception when the metric was re-added to the queue. This exception had the effect of shutting everything down. I moved the tag re-add code into a finally block so it gets executed regardless of whether an exception is thrown.

All other changes are minor (optimize includes, correct spelling, add debug messages).