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 ch...@apache.org on 2014/12/05 10:27:22 UTC

svn commit: r1643204 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java

Author: chetanm
Date: Fri Dec  5 09:27:22 2014
New Revision: 1643204

URL: http://svn.apache.org/viewvc?rev=1643204&view=rev
Log:
OAK-2321 - Provide details in log when reindexing is completed by AsyncIndexUpdate

Provide details around when the lease would expire

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java?rev=1643204&r1=1643203&r2=1643204&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java Fri Dec  5 09:27:22 2014
@@ -264,9 +264,11 @@ public class AsyncIndexUpdate implements
 
         // check for concurrent updates
         NodeState async = root.getChildNode(ASYNC);
-        if (async.getLong(name + "-lease") > System.currentTimeMillis()) {
+        long leaseEndTime = async.getLong(name + "-lease");
+        long currentTime = System.currentTimeMillis();
+        if (leaseEndTime > currentTime) {
             log.debug("Another copy of the {} index update is already running;"
-                    + " skipping this update", name);
+                    + " skipping this update. Time left for lease to expire {}s", name, (leaseEndTime - currentTime)/1000);
             return;
         }