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 mr...@apache.org on 2016/12/15 20:14:36 UTC

svn commit: r1774520 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/document/CommitQueue.java test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java

Author: mreutegg
Date: Thu Dec 15 20:14:35 2016
New Revision: 1774520

URL: http://svn.apache.org/viewvc?rev=1774520&view=rev
Log:
OAK-4687: Issue with backgroundOperationLock handling in exception case

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/CommitQueue.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/CommitQueue.java?rev=1774520&r1=1774519&r2=1774520&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/CommitQueue.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/CommitQueue.java Thu Dec 15 20:14:35 2016
@@ -233,14 +233,17 @@ final class CommitQueue {
             LOG.debug("not head: {}, waiting...", rev);
             commitEntry.await();
         }
-        c.headOfQueue(rev);
-        synchronized (this) {
-            commits.remove(rev);
-            try {
-                LOG.debug("removed {}, head is now {}", rev, commits.isEmpty() ? null : commits.firstKey());
-            } finally {
-                // notify next if there is any
-                notifyHead();
+        try {
+            c.headOfQueue(rev);
+        } finally {
+            synchronized (this) {
+                commits.remove(rev);
+                try {
+                    LOG.debug("removed {}, head is now {}", rev, commits.isEmpty() ? null : commits.firstKey());
+                } finally {
+                    // notify next if there is any
+                    notifyHead();
+                }
             }
         }
     }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java?rev=1774520&r1=1774519&r2=1774520&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java Thu Dec 15 20:14:35 2016
@@ -2703,7 +2703,6 @@ public class DocumentNodeStoreTest {
         assertTrue(parent.hasChildNode("baz"));
     }
 
-    @Ignore("OAK-4687")
     @Test
     public void exceptionHandlingInCommit() throws Exception{
         DocumentNodeStore ns = builderProvider.newBuilder().getNodeStore();
@@ -2718,7 +2717,6 @@ public class DocumentNodeStoreTest {
             }
         });
 
-
         NodeBuilder b1 = ns.getRoot().builder();
         b1.child("parent");
         failCommit.set(true);