You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/04/23 15:14:33 UTC

[GitHub] [accumulo] ctubbsii opened a new issue #1119: Improve Retry code

ctubbsii opened a new issue #1119: Improve Retry code
URL: https://github.com/apache/accumulo/issues/1119
 
 
   In our code, we often retry operations. So, we have an internal RetryFactory and a Retry object to handle that common pattern. The Retry object's `waitForNextAttempt` method does increment each wait time, by some fixed increment. However, this is problematic, in two ways:
   
   1. It's not exponential, and it should be, and
   2. There's no attempt to avoid repeated collisions.
   
   I saw the impact of this on a cluster that was creating a lot of files, and it was slowed down significantly when multiple processes were trying to allocate blocks of names from the UniqueNameAllocator, and kept colliding.
   
   It would be better to change the waitIncrement parameter to be a waitFactor, and to add some fuzziness.
   
   So, instead of:
   
   ```java
     currentWait = Math.min(maxWait, currentWait + waitIncrement);
   ```
   
   we could have something like:
   
   ```java
     currentWait = Math.min(maxWait, currentWait * (1+waitFactor+random.nextRandom()));
   ```
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services