You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by st...@apache.org on 2015/08/13 12:09:27 UTC

svn commit: r1695671 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java

Author: stefanegli
Date: Thu Aug 13 10:09:27 2015
New Revision: 1695671

URL: http://svn.apache.org/r1695671
Log:
OAK-2682 : config change: setting oak.documentMK.maxServerTimeDiffMillis to a negative, eg -1, disables the time diff check on startup

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java?rev=1695671&r1=1695670&r2=1695671&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java Thu Aug 13 10:09:27 2015
@@ -443,11 +443,13 @@ public class DocumentNodeStoreService {
         // max time diff of 2000 millis (2sec)
         final long maxDiff = Long.parseLong(System.getProperty("oak.documentMK.maxServerTimeDiffMillis", "2000"));
         try {
-            final long timeDiff = ds.determineServerTimeDifferenceMillis();
-            log.info("registerNodeStore: server time difference: {}ms (max allowed: {}ms)", timeDiff, maxDiff);
-            if (Math.abs(timeDiff) > Math.abs(maxDiff)) {
-                throw new AssertionError("Server clock seems off (" + timeDiff + "ms) by more than configured amount ("
-                        + maxDiff + "ms)");
+            if (maxDiff>=0) {
+                final long timeDiff = ds.determineServerTimeDifferenceMillis();
+                log.info("registerNodeStore: server time difference: {}ms (max allowed: {}ms)", timeDiff, maxDiff);
+                if (Math.abs(timeDiff) > maxDiff) {
+                    throw new AssertionError("Server clock seems off (" + timeDiff + "ms) by more than configured amount ("
+                            + maxDiff + "ms)");
+                }
             }
         } catch (RuntimeException e) { // no checked exception
             // in case of a RuntimeException, just log but continue