[ 
https://issues.apache.org/jira/browse/HADOOP-18567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chengbing Liu updated HADOOP-18567:
-----------------------------------
    Attachment:     (was: HADOOP-18567.01.patch)

> LogThrottlingHelper: the dependent recorder is not triggered correctly
> ----------------------------------------------------------------------
>
>                 Key: HADOOP-18567
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18567
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 3.3.4
>            Reporter: Chengbing Liu
>            Priority: Major
>              Labels: pull-request-available
>
> The current implementation of {{LogThrottlingHelper}} works well most of the 
> time, but it missed out one case, which appears quite common in the 
> production codes:
> - if the dependent recorder was not suppressed before the primary one is 
> triggered on the next period, then the next logging of the dependent recorder 
> will be unexpectedly suppressed.
> {code:java}
>     helper = new LogThrottlingHelper(LOG_PERIOD, "foo", timer);
>     assertTrue(helper.record("foo", 0).shouldLog());
>     assertTrue(helper.record("bar", 0).shouldLog());
>     // Both should log once the period has elapsed
>     // <pos1>
>     assertTrue(helper.record("foo", LOG_PERIOD).shouldLog());
>     assertTrue(helper.record("bar", LOG_PERIOD).shouldLog()); <--- This 
> assertion will now fail
> {code}
> Note if we call {{helper.record("bar", LOG_PERIOD * 2)}} in <pos1>, as the 
> existing test cases do, it will work as expected.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to