Github user HeartSaVioR commented on a diff in the pull request:
https://github.com/apache/storm/pull/1324#discussion_r61901102
--- Diff:
storm-core/src/jvm/org/apache/storm/metric/MetricsConsumerBolt.java ---
@@ -47,17 +68,71 @@ public void prepare(Map stormConf, TopologyContext
context, OutputCollector coll
}
_metricsConsumer.prepare(stormConf, _registrationArgument,
context, collector);
_collector = collector;
+ _taskExecuteThread = new Thread(new MetricsHandlerRunnable());
+ _taskExecuteThread.setDaemon(true);
+ _taskExecuteThread.start();
}
@Override
public void execute(Tuple input) {
-
_metricsConsumer.handleDataPoints((IMetricsConsumer.TaskInfo)input.getValue(0),
(Collection)input.getValue(1));
+ // remove older tasks if task queue exceeds the max size
+ if (_taskQueue.size() > _maxRetainMetricTuples) {
+ while (_taskQueue.size() - 1 > _maxRetainMetricTuples) {
--- End diff --
I guess maybe it could drop one more item but it's not a big deal anyway.
Ideally, taskQueue exceeding the max retain metric tuples should not occur.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---