lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1694913 - /lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
Date Sun, 09 Aug 2015 21:46:42 GMT
Author: erick
Date: Sun Aug  9 21:46:41 2015
New Revision: 1694913

URL: http://svn.apache.org/r1694913
Log:
SOLR-7836: Possible deadlock when closing refcounted index writers. Surrounded ulog updates
with updatelock

Modified:
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java?rev=1694913&r1=1694912&r2=1694913&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java Sun
Aug  9 21:46:41 2015
@@ -241,8 +241,9 @@ public class DirectUpdateHandler2 extend
     } finally {
       iw.decref();
     }
-
-    if (ulog != null) ulog.add(cmd);
+    synchronized (solrCoreState.getUpdateLock()) {
+      if (ulog != null) ulog.add(cmd);
+    }
   }
 
   private void doNormalUpdate(AddUpdateCommand cmd) throws IOException {
@@ -288,7 +289,9 @@ public class DirectUpdateHandler2 extend
     // This also ensures that if a commit sneaks in-between, that we
     // know everything in a particular
     // log version was definitely committed.
-    if (ulog != null) ulog.add(cmd);
+    synchronized (solrCoreState.getUpdateLock()) {
+      if (ulog != null) ulog.add(cmd);
+    }
   }
 
   private void addAndDelete(AddUpdateCommand cmd, List<UpdateLog.DBQ> deletesAfter)
throws IOException {
@@ -324,7 +327,9 @@ public class DirectUpdateHandler2 extend
     } finally {
       iw.decref();
     }
-    if (ulog != null) ulog.add(cmd, true);
+    synchronized (solrCoreState.getUpdateLock()) {
+      if (ulog != null) ulog.add(cmd, true);
+    }
   }
 
   private void updateDeleteTrackers(DeleteUpdateCommand cmd) {



Mime
View raw message