stefan-egli commented on code in PR #1288:
URL: https://github.com/apache/jackrabbit-oak/pull/1288#discussion_r1469983458


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java:
##########
@@ -229,13 +229,14 @@ static RecoverLockState fromString(String state) {
     /** OAK-3399 : max number of times we're doing a 1sec retry loop just 
before declaring lease failure **/
     private static final int MAX_RETRY_SLEEPS_BEFORE_LEASE_FAILURE = 5;
 
-    /** OAK-10281 : seconds to delay a recovery after a lease timeout */
-    private static final int DEFAULT_RECOVERY_DELAY_SECS = 
SystemPropertySupplier.create("oak.documentMK.recoveryDelaySecs", 0)
-            .loggingTo(LOG).validateWith(value -> value >= 0)
-            .formatSetMessage((name, value) -> String.format("recovery delay 
set to (secs): %ss (using system property %s)", name, value)).get();
-    private static final long DEFAULT_RECOVERY_DELAY_MILLIS = 1000L * 
(long)DEFAULT_RECOVERY_DELAY_SECS;
+    /** OAK-10281 : default millis to delay a recovery after a lease timeout */
+    static final long DEFAULT_RECOVERY_DELAY_MILLIS = 0;
 
-    // kept non-final for testing purpose
+    /**
+     * Actual millis to delay a recovery after a lease timeout.
+     * <p>
+     * Initialized by DocumentNodeStore constructor.
+     */
     static long recoveryDelayMillis = DEFAULT_RECOVERY_DELAY_MILLIS;

Review Comment:
   That would have been an option, but given I like to explicitly overwrite it 
in tests, I have now chosen the non final way. What's the advantage of having 
it final?



##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java:
##########
@@ -520,6 +520,9 @@ public void handleLeaseFailure() {
         if (isThrottlingEnabled(builder)) {
             builder.setThrottlingStatsCollector(new 
ThrottlingStatsCollectorImpl(statisticsProvider));
         }
+
+        // initialize the (global) recoveryDelayMillis
+        
ClusterNodeInfo.setRecoveryDelayMillis(builder.getRecoveryDelayMillis());

Review Comment:
   recoveryDelayMillis is static though?



-- 
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: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to