You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2014/11/24 17:11:13 UTC

[jira] [Updated] (LUCENE-6075) SimpleRateLimiter cast overflow results in Thread.sleep exception

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

Michael McCandless updated LUCENE-6075:
---------------------------------------
    Attachment: LUCENE-6075.patch

Simple patch w/ test.

> SimpleRateLimiter cast overflow results in Thread.sleep exception
> -----------------------------------------------------------------
>
>                 Key: LUCENE-6075
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6075
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/store
>            Reporter: Boaz Leskes
>            Assignee: Michael McCandless
>         Attachments: LUCENE-6075.patch
>
>
> SimpleRateLimiter.pause() uses an uncheck cast of longs to ints:
>             Thread.sleep((int) (pauseNS/1000000), (int) (pauseNS % 1000000));
> Although we check that pauseNS is positive, however if it's large enough the cast to int produces a negative value, causing Thread.sleep to throw an exception.
> We should protect for it.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org