Author: frm
Date: Tue Jun 18 14:44:54 2019
New Revision: 1861581

URL: http://svn.apache.org/viewvc?rev=1861581&view=rev
Log:
OAK-8412 - Set a retry strategy for AzurePersistence

Modified:
    
jackrabbit/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzurePersistence.java

Modified: 
jackrabbit/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzurePersistence.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzurePersistence.java?rev=1861581&r1=1861580&r2=1861581&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzurePersistence.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzurePersistence.java
 Tue Jun 18 14:44:54 2019
@@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit;
 
 import com.microsoft.azure.storage.OperationContext;
 import com.microsoft.azure.storage.RequestCompletedEvent;
+import com.microsoft.azure.storage.RetryLinearRetry;
 import com.microsoft.azure.storage.StorageEvent;
 import com.microsoft.azure.storage.StorageException;
 import com.microsoft.azure.storage.blob.BlobListingDetails;
@@ -55,6 +56,9 @@ public class AzurePersistence implements
         this.segmentstoreDirectory = segmentStoreDirectory;
 
         BlobRequestOptions defaultRequestOptions = 
segmentStoreDirectory.getServiceClient().getDefaultRequestOptions();
+        if (defaultRequestOptions.getRetryPolicyFactory() == null) {
+            defaultRequestOptions.setRetryPolicyFactory(new 
RetryLinearRetry((int) TimeUnit.SECONDS.toMillis(5), 5));
+        }
         if (defaultRequestOptions.getMaximumExecutionTimeInMs() == null) {
             defaultRequestOptions.setMaximumExecutionTimeInMs((int) 
TimeUnit.SECONDS.toMillis(30));
         }


Reply via email to