[ 
https://issues.apache.org/jira/browse/HADOOP-12588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15341422#comment-15341422
 ] 

Masatake Iwasaki commented on HADOOP-12588:
-------------------------------------------

If metrics is published by the timer in MetricsSystemImpl after sinks are 
registered and before metrics system is stopped, we get metrics more than 
expected, though I could not reproduce this without adding artificial delay on 
my environment.

{code}
    // register the sinks
    ms.register("gsink30", "gsink30 desc", gsink30);
    ms.register("gsink31", "gsink31 desc", gsink31);
    ms.publishMetricsNow(); // publish the metrics

    ms.stop();
{code}

We can avoid the situation by setting long publishing interval. Since we 
manually publish metrics by calling {{publishMetricsNow}}, we don't need 
periodic publishing. The configuration to set the interval must be {{*.period}} 
rather than {{default.period}}.

I will upload a patch addressing this.


> Fix intermittent test failure of TestGangliaMetrics
> ---------------------------------------------------
>
>                 Key: HADOOP-12588
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12588
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Tsuyoshi Ozawa
>            Assignee: Masatake Iwasaki
>         Attachments: HADOOP-12588.001.patch, HADOOP-12588.addendum.02.patch, 
> HADOOP-12588.addendum.patch
>
>
> Jenkins found this test failure on HADOOP-11149.
> {quote}
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.773 sec <<< 
> FAILURE! - in org.apache.hadoop.metrics2.impl.TestGangliaMetrics
> testGangliaMetrics2(org.apache.hadoop.metrics2.impl.TestGangliaMetrics)  Time 
> elapsed: 0.39 sec  <<< FAILURE!
> java.lang.AssertionError: Missing metrics: test.s1rec.Xxx
>       at org.junit.Assert.fail(Assert.java:88)
>       at org.junit.Assert.assertTrue(Assert.java:41)
>       at 
> org.apache.hadoop.metrics2.impl.TestGangliaMetrics.checkMetrics(TestGangliaMetrics.java:159)
>       at 
> org.apache.hadoop.metrics2.impl.TestGangliaMetrics.testGangliaMetrics2(TestGangliaMetrics.java:137)
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to