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

Boaz Leskes commented on LUCENE-6075:
-------------------------------------

Yeah, that's the tricky part which made me wonder (as opposed to a suggestion 
:)) The only thought I had is maintaining a last update time stamp (on top on 
lastNS) and if that goes backwards, adapt for it? I'm not sure how often this 
happens in practice though. From the reaction, I judge that it's not really 
often and we just have stepped into a very rare case. I'm OK with leaving as 
is. Thx for the fix!

> 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
>             Fix For: 4.10.3, Trunk, 5.x
>
>         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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to