Compute retry delay with exponential backoff.
int getRetryDelay(int attempt) { // Exponential backoff: 1s, 2s, 4s, ... return 1000 * (1 << (attempt - 1)); }