You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Chengbing Liu (Jira)" <ji...@apache.org> on 2022/12/12 06:50:00 UTC

[jira] [Updated] (HADOOP-18567) LogThrottlingHelper: the dependent recorder is not triggered correctly

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

Chengbing Liu updated HADOOP-18567:
-----------------------------------
    Attachment: HADOOP-18567.01.patch
        Status: Patch Available  (was: Open)

Attached a patch, [~xkrogen] please have a look.

> 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
>         Attachments: HADOOP-18567.01.patch
>
>
> 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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org