ddanielr opened a new issue, #4261: URL: https://github.com/apache/accumulo/issues/4261
**Is your feature request related to a problem? Please describe.** The Retry class is used to calculate some interval for re-attempting a function call. https://github.com/apache/accumulo/blob/978f8b9ecaac2518ad3f2559512cf11d5fdd3901/core/src/main/java/org/apache/accumulo/core/util/Retry.java#L36 Most units in the Retry class are time-based (`startWait`, `waitIncrement`, `maxWait`) with various modifiers (`backOffFactor`, `jitter`). Retry has a concept of `maxRetries` to set a limit on how many attempts can be executed before the retry is complete. When `maxRetries` is set, there is typically not any clear indication as to how long that retry operation will wait. This is because the `maxRetries` option is not a time-based value, rather it is a set limit of retry attempts. Due to the incremental back-off nature of the Retry class, this set limit causes complications when attempting to Retry for a set length of time. To correctly debug if a Retry duration is set correctly, it requires calculating the max duration based on the values of the `startWait`, `waitIncrement`, `maxWait`, `backOffFactor`, and `jitter` options. **Describe the solution you'd like** A new method should be added to the `NeedsRetries` interface to calculate the number of retries for a given time interval. https://github.com/apache/accumulo/blob/978f8b9ecaac2518ad3f2559512cf11d5fdd3901/core/src/main/java/org/apache/accumulo/core/util/Retry.java#L260 This method would take the startWait, waitIncrement, maxWait, backOffFactor, and jitter options and set the `maxRetries` option to the value closest to the provided duration. **Describe alternatives you've considered** Calculating the maxRetries for each use of the Retry class was considered, however that would require pulling all of the relevant option values back to the calling context and never abstracting away the Retry Object. That would just add further complexity to classes like RetryableThriftCall https://github.com/apache/accumulo/blob/978f8b9ecaac2518ad3f2559512cf11d5fdd3901/server/base/src/main/java/org/apache/accumulo/server/compaction/RetryableThriftCall.java#L81-L83 **Additional context** Given the nature of jitter and stepIncrements, there is a possibility that the Retry could wait longer or shorter than the provided duration. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
