rishabhdaim commented on code in PR #1288: URL: https://github.com/apache/jackrabbit-oak/pull/1288#discussion_r1469944510
########## 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: I would initialize `recoveryDelayMillis` from the constructor. ########## 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: I would make this field final and if needed would use reflection to override value in test cases. See https://github.com/apache/jackrabbit-oak/blob/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java#L434 -- 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