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 "Sean Mackrory (JIRA)" <ji...@apache.org> on 2018/07/11 07:58:00 UTC
[jira] [Commented] (HADOOP-15316) GenericTestUtils can exceed
maxSleepTime
[ https://issues.apache.org/jira/browse/HADOOP-15316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539674#comment-16539674 ]
Sean Mackrory commented on HADOOP-15316:
----------------------------------------
Thanks for picking this up. The code looks good to me. +1 pending a clean Yetus run.
> GenericTestUtils can exceed maxSleepTime
> ----------------------------------------
>
> Key: HADOOP-15316
> URL: https://issues.apache.org/jira/browse/HADOOP-15316
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Sean Mackrory
> Assignee: Adam Antal
> Priority: Trivial
> Attachments: HADOOP-15316.001.patch
>
>
> Probably shouldn't ever cause an issue, especially since Thread.sleep() can cause longer delays beyond your control anyway, but for larger values this could still behave unpredicatably in practice.
> {code:java}
> Thread.sleep(r.nextInt(maxSleepTime) + minSleepTime);
> {code}
> should be
> {code:java}
> Thread.sleep(r.nextInt(maxSleepTime - minSleepTime) + minSleepTime){code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org