# Retry Limit Configuration

## Introduction
The following system properties and JMX bean are provided to allow the user to control when and how often retries occur for storage transactions.

## System Properties
The following system properties can be used to control when and how often a retry occurs:

```
nexus.tx.retry.limit=8            # maximum times a transaction can retry
nexus.tx.retry.minSlots=2         # minimum number of backoff slots
nexus.tx.retry.maxSlots=256       # maximum number of backoff slots
nexus.tx.retry.minorDelay=10ms    # per-slot delay if it's a minor exception
nexus.tx.retry.majorDelay=100ms   # per-slot delay if it's a major exception

# comma-separated list of exceptions to treat as "major"
nexus.tx.retry.majorExceptionFilter=\
  java.io.IOException,org.sonatype.nexus.repository.storage.MissingBlobException

# comma-separated list of exceptions to treat as "noisy" - these exceptions won't contribute to the excessive retry metrics
nexus.tx.retry.noisyExceptionFilter=\
  org.sonatype.nexus.repository.browse.internal.orient.BrowseNodeCollisionException
```

`IOExceptions` and `MissingBlobExceptions` are treated as major exceptions which result in longer backoff delays before retrying. This is because these exceptions are often related to slower (networked) storage which works best with a longer delay before retrying. When running in HA-C various distributed exceptions are also listed as major for the same reason.

## RetryControllerBean

|     |
| --- |
|  |

This JMX bean can be used to tune the retry settings at runtime without rebooting.

### Attributes

#### RetryLimit

|     |
| --- |
|  |

The maximum number of times a transaction can retry.

#### MinSlots

|     |
| --- |
|  |

The minimum number of backoff slots.

#### MaxSlots

|     |
| --- |
|  |

The maximum number of backoff slots.

#### MinorDelayMillis

|     |
| --- |
|  |

The per-slot delay if it's a minor exception.

#### MajorDelayMillis

|     |
| --- |
|  |

The per-slot delay if it's a major exception.

#### MajorExceptionFilter

|     |
| --- |
|  |

A comma-separated list of exceptions (fully qualified names) to treat as "major".

## References
- [https://en.wikipedia.org/wiki/Exponential_backoff](https://en.wikipedia.org/wiki/Exponential_backoff)
