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 2016/02/01 08:09:22 UTC

svn commit: r1727893 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java

Author: chetanm
Date: Mon Feb  1 07:09:22 2016
New Revision: 1727893

URL: http://svn.apache.org/viewvc?rev=1727893&view=rev
Log:
OAK-3923 - Async indexing delayed by 30 minutes because stop order is incorrect

Support multiple close calls. Without this change a second close call would go for timeout and hence would cause unnecessary delay

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.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=1727893&r1=1727892&r2=1727893&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 Mon Feb  1 07:09:22 2016
@@ -332,6 +332,9 @@ public class AsyncIndexUpdate implements
 
     @Override
     public void close() {
+        if (closed) {
+            return;
+        }
         int hardTimeOut = 5 * softTimeOutSecs;
         if(!runPermit.tryAcquire()){
             //First let current run complete without bothering it

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java?rev=1727893&r1=1727892&r2=1727893&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java Mon Feb  1 07:09:22 2016
@@ -1046,6 +1046,8 @@ public class AsyncIndexUpdateTest {
         assertThat(lc.getLogs().get(0), containsString("Could not acquire run permit"));
 
         lc.finished();
+
+        async.close();
     }
 
     @Test