configured maximum number of retries.
431153
private void commitMutations(DBTransaction dbTran, long timestamp) {
        Map<ByteBuffer, Map<String, List<Mutation>>> colMutMap = CassandraTransaction.getUpdateMap(dbTran, timestamp);
        if (colMutMap.size() == 0) {
            return;
        }
        m_logger.debug("Committing {} mutations", CassandraTransaction.totalColumnMutations(dbTran));
        
        // The batch_mutate will be retried up to MAX_COMMIT_RETRIES times.
        boolean bSuccess = false;
        for (int attempts = 1; !bSuccess; attempts++) {
            try {
                // Attempt to commit all updates in the the current mutation map.
                Date startDate = new Date();
                m_client.batch_mutate(colMutMap, ConsistencyLevel.ONE);
                timing("commitMutations", startDate);
                if (attempts > 1) {
                    // Since we had a failure and warned about it, confirm which attempt succeeded.
                    m_logger.info("batch_mutate() succeeded on attempt #{}", attempts);
                }
                bSuccess = true;
            } catch (InvalidRequestException ex) {
                // No point in retrying this one.
                m_bFailed = true;
                m_logger.error("batch_mutate() failed", ex);
                throw new RuntimeException("batch_mutate() failed", ex);
            } catch (Exception ex) {
                // If we've reached the retry limit, we fail this commit.
                if (attempts >= m_max_commit_attempts) {
                    m_bFailed = true;
                    m_logger.error("All retries exceeded; abandoning batch_mutate()", ex);
                    throw new RuntimeException("All retries exceeded; abandoning batch_mutate()", ex);
                }
                
                // Report retry as a warning.
                m_logger.warn("batch_mutate() attempt #{} failed: {}", attempts, ex);
                try {
                    // We wait more with each failure.
                    Thread.sleep(attempts * m_retry_wait_millis);
                } catch (InterruptedException e1) {
                    // ignore
                }
                
                // Experience suggests that even for timeout exceptions, the connection
                // may be bad, so we attempt to reconnect. If this fails, it will throw
                // an DBNotAvailableException, which we pass to the caller.
                reconnect(ex);
            }
        }
    }
1078721
function retryStrategy (ravelInstance) {
  return function (options) {
    const code = options.error ? options.error.code : 'Reason Unknown';
    if (code === 'ECONNREFUSED') {
      // End reconnecting on a specific error and flush all commands with a individual error
      ravelInstance.$log.error(`Lost connection to redis: ${code}.`);
      return new $err.General(`Lost connection to redis: ${code}.`);
    } else if (options.attempt > ravelInstance.get('redis max retries')) {
      ravelInstance.$log.error(`Lost connection to redis: ${code}. Max retry attempts exceeded.`);
      // End reconnecting with built in error
      return new $err.General(
        `Lost connection to redis: ${code}. Max retry attempts reached.`);
    } else {
      const time = Math.pow(options.attempt, 2) * 100;
      ravelInstance.$log.error(`Lost connection to redis: ${code}. Reconnecting in ${time} milliseconds.`);
      // reconnect after
      return time;
    }
  };
}
569379
def get_countdown(self, retries) -> int:
        """"""
        retry_delay = self.retry_delay
        if self.retry_exponential_backoff:
            return min(
                max(2 ** retries, retry_delay),  # Exp. backoff
                self.max_retry_delay  # The countdown should be more the max allowed
            )
        return retry_delay
760542
def reset_for_retry(self, output_writer):
    
    self.input_reader = self.initial_input_reader
    self.slice_id = 0
    self.retries += 1
    self.output_writer = output_writer
    self.handler = self.mapreduce_spec.mapper.handler
1232603
public RetryInterceptorBuilder<T> maxAttempts(int maxAttempts) {
		Assert.isNull(this.retryOperations,
				"cannot alter the retry policy when a custom retryOperations has been set");
		Assert.isTrue(!this.retryPolicySet,
				"cannot alter the retry policy when a custom retryPolicy has been set");
		this.simpleRetryPolicy.setMaxAttempts(maxAttempts);
		this.retryTemplate.setRetryPolicy(this.simpleRetryPolicy);
		this.templateAltered = true;
		return this;
	}
543120
def _should_retry(resp):
  """"""
  return (resp.status_code == httplib.REQUEST_TIMEOUT or
          (resp.status_code >= 500 and
           resp.status_code < 600))
18044
private static RetrySettings buildIdempotentRetrySettings(RetrySettings retrySettings,
      BigtableOptions options) {
    RetryOptions retryOptions = options.getRetryOptions();
    CallOptionsConfig callOptions = options.getCallOptionsConfig();
    RetrySettings.Builder retryBuilder = retrySettings.toBuilder();

    if (retryOptions.allowRetriesWithoutTimestamp()) {
      throw new UnsupportedOperationException("Retries without Timestamp does not support yet.");
    }

    // if useTimeout is false, then RPC's are defaults to 6 minutes.
    Duration rpcTimeout = ofMillis(callOptions.isUseTimeout()
        ? callOptions.getShortRpcTimeoutMs()
        : RPC_DEADLINE_MS);

    retryBuilder
        .setInitialRetryDelay(ofMillis(retryOptions.getInitialBackoffMillis()))
        .setRetryDelayMultiplier(retryOptions.getBackoffMultiplier())
        .setMaxRetryDelay(ofMillis(MAX_RETRY_TIMEOUT_MS))
        .setInitialRpcTimeout(rpcTimeout)
        .setMaxRpcTimeout(rpcTimeout)
        .setMaxAttempts(0)
        .setTotalTimeout(ofMillis(retryOptions.getMaxElapsedBackoffMillis()));

    return retryBuilder.build();
  }
49928
private function _pauseOnRetry($retries)
    {
        if ($retries <= $this->_config['MaxErrorRetry']) {
            $delay = (int) (pow(4, $retries) * 100000);
            usleep($delay);
            return true;
        } 
        return false;
    }
318392
@Override
	public SqlAgentFactory setDefaultMaxRetryCount(final int defaultMaxRetryCount) {
		getDefaultProps().put(PROPS_KEY_DEFAULT_MAX_RETRY_COUNT, String.valueOf(defaultMaxRetryCount));
		return this;
	}
1080178
public function retryAll()
    {
        foreach ($this->getFailedFiles() as $file) {
            // Rename the file first
            $tmpFile = dirname($file) . '/retrying-' . basename($file);
            rename($file, $tmpFile);

            $fp = @fopen($tmpFile, 'r');
            if ($fp === false) {
                fwrite(
                    STDERR,
                    sprintf('Could not open the file: %s' . PHP_EOL, $tmpFile)
                );
                continue;
            }
            while ($line = fgets($fp)) {
                $a = unserialize($line);
                $idNum = key($a);
                $job = $this->runner->getJobFromIdNum($idNum);
                if (! $job->callFunc($a[$idNum])) {
                    $this->handleFailure($idNum, $a[$idNum]);
                }
            }
            @fclose($fp);
            @unlink($tmpFile);
        }
    }
535083
def retry_interval(expires_at, attempts, max_retries = nil)
      if @options[:retry_enabled]
        if max_retries.nil? || attempts <= max_retries
          interval = @options[:retry_intervals][attempts - 1] || @options[:retry_intervals][-1]
          ((Time.now + interval) < expires_at) ? interval : 0
        else
          0
        end
      end
    end
363038
public static function setRetryLimit($num){
        if($num<1){
            throw new HttpException('Limit '.(int)$num.' is too low', HttpException::LIMIT_TOO_LOW);
        }

        self::$retryLimit = $num;
    }
1009508
public function allowedRetries()
  {
    if (isset($this->retryMap[$this->code])) {
      return $this->retryMap[$this->code];
    }

    return 0;
  }
79754
def re_enqueue(self, item):
        """"""
        if 'retries' in item:
            retries = item['retries']
            if retries >= self.MAX_RETRIES:
                log.warn("Failed to execute {} after {} retries, give it "
                         " up.".format(item['method'], retries))
            else:
                retries += 1
                item['retries'] = retries
                self._q.put_nowait(item)
        else:
            item['retries'] = 1
            self._q.put_nowait(item)
1295358
def retry(default=None):
    """"""

    def decorator(func):
        """Retry decorator"""

        @functools.wraps(func)
        def _wrapper(*args, **kw):
            for pos in range(1, MAX_RETRIES):
                try:
                    return func(*args, **kw)
                except (RuntimeError, requests.ConnectionError) as error:
                    LOGGER.warning("Failed: %s, %s", type(error), error)

                # Wait a bit before retrying
                for _ in range(pos):
                    _rest()

            LOGGER.warning("Request Aborted")
            return default

        return _wrapper

    return decorator
1217050
def save(self, *args, **kwargs):
        """"""

        max_retries = getattr(
            settings,
            'LOCALIZED_FIELDS_MAX_RETRIES',
            100
        )

        if not hasattr(self, 'retries'):
            self.retries = 0

        with transaction.atomic():
            try:
                return super().save(*args, **kwargs)
            except IntegrityError as ex:
                # this is as retarded as it looks, there's no
                # way we can put the retry logic inside the slug
                # field class... we can also not only catch exceptions
                # that apply to slug fields... so yea.. this is as
                # retarded as it gets... i am sorry :(
                if 'slug' not in str(ex):
                    raise ex

                if self.retries >= max_retries:
                    raise ex

        self.retries += 1
        return self.save()
92350
def set_recursion_limit(limit):
    """"""
    if limit < minimum_recursion_limit:
        raise CoconutException("--recursion-limit must be at least " + str(minimum_recursion_limit))
    sys.setrecursionlimit(limit)