private void updateSecureConfigWithRetry()

in github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/OAuthWebFilter.java [147:180]


  private void updateSecureConfigWithRetry(
      Set<String> organisations, String user, String access_token) {
    int retryCount = 0;

    while (retryCount < config.fileUpdateMaxRetryCount) {
      try {
        updateSecureConfig(organisations, user, access_token);
        return;
      } catch (IOException e) {
        retryCount++;
        int retryInterval = retryRandom.nextInt(config.fileUpdateMaxRetryIntervalMsec);
        log.warn(
            "Error whilst trying to update "
                + sites.secure_config
                + (retryCount < config.fileUpdateMaxRetryCount
                    ? ": attempt #"
                        + retryCount
                        + " will be retried after "
                        + retryInterval
                        + " msecs"
                    : ""),
            e);
        try {
          Thread.sleep(retryInterval);
        } catch (InterruptedException e1) {
          log.error("Thread has been cancelled before retrying to save " + sites.secure_config);
          return;
        }
      } catch (ConfigInvalidException e) {
        log.error("Cannot update " + sites.secure_config + " as the file is corrupted", e);
        return;
      }
    }
  }