You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by "shenjianeng (via GitHub)" <gi...@apache.org> on 2023/11/22 08:50:04 UTC

[PR] fix sleepMs overflow [curator]

shenjianeng opened a new pull request, #490:
URL: https://github.com/apache/curator/pull/490

   fix sleepMs overflow
   
   ```java
   public class Main {
       private static final Random random = new Random();
       private static int baseSleepTimeMs = Integer.MAX_VALUE;
   
       public static void main(String[] args) {
           int retryCount = 2;
           long sleepMs1 = baseSleepTimeMs * Math.min(2, random.nextInt(1 << (retryCount + 1)));
           long sleepMs2 = (long) baseSleepTimeMs * Math.min(2, random.nextInt(1 << (retryCount + 1)));
           System.out.println(sleepMs1);
           System.out.println(sleepMs2);
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@curator.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CURATOR-262. Fix sleepMs overflow [curator]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #490:
URL: https://github.com/apache/curator/pull/490#issuecomment-1846673497

   This is actually a follow-up to https://github.com/apache/curator/pull/136 where we introduce the bug by missing integers casting.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@curator.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CURATOR-262. Fix sleepMs overflow [curator]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #490:
URL: https://github.com/apache/curator/pull/490#issuecomment-1863836819

   Merging ...
   
   Thanks for your contribution!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@curator.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CURATOR-262. Fix sleepMs overflow [curator]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun merged PR #490:
URL: https://github.com/apache/curator/pull/490


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@curator.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org