gerlowskija commented on code in PR #5387:
URL: https://github.com/apache/solr/pull/5387#discussion_r4723433958


##########
solr/core/src/java/org/apache/solr/core/backup/repository/BackupRepositoryFactory.java:
##########
@@ -93,7 +100,20 @@ public BackupRepository newInstance(SolrResourceLoader 
loader, String name) {
       delegatingRepo.setDelegate(delegate);
     }
 
-    return backupRepository;
+    return withRetries(backupRepository);
+  }
+
+  /**
+   * Wraps {@code repo} so failed file copies are retried, unless {@code 
solr.backup.maxcopyretries}
+   * is 0.
+   */
+  private static BackupRepository withRetries(BackupRepository repo) {
+    int maxRetries = EnvUtils.getPropertyAsInteger(MAX_COPY_RETRIES_PROP, 2);
+    if (maxRetries <= 0) {
+      return repo;
+    }
+    long backoffMillis = 
EnvUtils.getPropertyAsLong(COPY_RETRY_BACKOFF_MILLIS_PROP, 1000L);

Review Comment:
   Done!



##########
solr/core/src/java/org/apache/solr/core/backup/repository/BackupRepositoryFactory.java:
##########
@@ -93,7 +100,20 @@ public BackupRepository newInstance(SolrResourceLoader 
loader, String name) {
       delegatingRepo.setDelegate(delegate);
     }
 
-    return backupRepository;
+    return withRetries(backupRepository);
+  }
+
+  /**
+   * Wraps {@code repo} so failed file copies are retried, unless {@code 
solr.backup.maxcopyretries}
+   * is 0.
+   */
+  private static BackupRepository withRetries(BackupRepository repo) {
+    int maxRetries = EnvUtils.getPropertyAsInteger(MAX_COPY_RETRIES_PROP, 2);

Review Comment:
   Done!



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to