[
https://issues.apache.org/jira/browse/SAMZA-801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14979552#comment-14979552
]
Roger Hoover commented on SAMZA-801:
------------------------------------
[~nickpan47], I'm not sure exactly what you mean by safeRun(). The Runnable
interface requires that the method be named run(). However, we could move the
logic to a method called reportMetrics(). Then the run() method would kinda
like this (ignore syntax errors):
{code:java}
try {
reportMetrics();
}
catch(Exception e) {
log.error(e);
}
{code}
> MetricsSnapshotReporter cannot tolerate errors
> -----------------------------------------------
>
> Key: SAMZA-801
> URL: https://issues.apache.org/jira/browse/SAMZA-801
> Project: Samza
> Issue Type: Bug
> Components: metrics
> Affects Versions: 0.9.1
> Reporter: Roger Hoover
>
> If an error occurs in MetricsSnapshotReporter.run(), it does not get logged
> anywhere and Executor.scheduleWithFixedDelay() will not reschedule it. The
> effect is that metrics stop being sent to the metrics topic.
> There should be a try/catch in MetricsSnapshotReporter.run() which logs
> errors and suppresses them to that the thread still had a chance to run again.
> I ran into this by creating a custom metric
> (https://github.com/Quantiply/rico/blob/master/core/src/main/java/com/quantiply/samza/metrics/WindowedMapGauge.java)
> that was accidentally unserializable.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)