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

ASF GitHub Bot commented on YARN-11541:
---------------------------------------

github-actions[bot] commented on PR #6050:
URL: https://github.com/apache/hadoop/pull/6050#issuecomment-3395512662

   We're closing this stale PR because it has been open for 100 days with no 
activity. This isn't a judgement on the merit of the PR in any way. It's just a 
way of keeping the PR queue manageable.
   If you feel like this was a mistake, or you would like to continue working 
on it, please feel free to re-open it and ask for a committer to remove the 
stale tag and review again.
   Thanks all for your contribution.




> AsyncDispatcher causes ArithmeticException due to improper detailsInterval 
> value checking
> -----------------------------------------------------------------------------------------
>
>                 Key: YARN-11541
>                 URL: https://issues.apache.org/jira/browse/YARN-11541
>             Project: Hadoop YARN
>          Issue Type: Bug
>    Affects Versions: 3.3.3
>            Reporter: ConfX
>            Priority: Critical
>              Labels: pull-request-available
>         Attachments: reproduce.sh
>
>
> h2. What happened
> There is no value checking for parameter 
> {{{}yarn.dispatcher.print-events-info.threshold{}}}. This may cause improper 
> calculations and crashes the system like division by 0.
> h2. Buggy code
> In {{{}AsyncDispatcher.java{}}}, there is no value checking for 
> {{detailsInterval}} and this variable is directly used in the event handler. 
> When {{detailsInterval}} is mistakenly set to 0, the code would cause 
> division by 0 and throw ArithmeticException to crash the system.
> {noformat}
>     public void handle(Event event) {
>     . . . 
>       if (qSize != 0 && qSize % detailsInterval == 0                 // 
> detailsInterval gets its value from the aforementioned config param 
>               && lastEventDetailsQueueSizeLogged != qSize) {
>     . . .{noformat}
> h2. How to reproduce
> (1) set yarn.dispatcher.print-events-info.threshold=0
> (2) run 
> org.apache.hadoop.yarn.event.TestAsyncDispatcher#testDispatcherMetricsHistogram
> you should observe the following failure:
> {noformat}
> java.lang.ArithmeticException: / by zero
>     at 
> org.apache.hadoop.yarn.event.AsyncDispatcher$GenericEventHandler.handle(AsyncDispatcher.java:348)
>     at 
> org.apache.hadoop.yarn.event.TestAsyncDispatcher.testDispatcherMetricsHistogram(TestAsyncDispatcher.java:370)
>         ...{noformat}
> For an easy reproduction, run the reproduce.sh in the attachment.
> We are happy to provide a patch if this issue is confirmed.



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

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

Reply via email to