Author: chetanm
Date: Tue Feb 23 05:07:56 2016
New Revision: 1731789
URL: http://svn.apache.org/viewvc?rev=1731789&view=rev
Log:
OAK-4035 - AsyncIndexUpdate should not log exception when its forcibly stopped
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=1731789&r1=1731788&r2=1731789&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
Tue Feb 23 05:07:56 2016
@@ -700,6 +700,12 @@ public class AsyncIndexUpdate implements
}
public void failed(Exception e) {
+ if (e == INTERRUPTED){
+ log.info("[{}] The index update interrupted", name);
+ log.debug("[{}] The index update interrupted", name, e);
+ return;
+ }
+
latestError = getStackTraceAsString(e);
latestErrorTime = now();
consecutiveFailures++;
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=1731789&r1=1731788&r2=1731789&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
Tue Feb 23 05:07:56 2016
@@ -1186,11 +1186,12 @@ public class AsyncIndexUpdateTest {
//Wait for both threads
t.join();
- //Async run would have failed with exception
- assertNotNull(async.getIndexStats().getLatestError());
+ //Async run would have exited with log message logged
+ assertLogPhrase(lc.getLogs(), "The index update interrupted");
//Wait for close call to complete
closer.join();
+ lc.finished();
}