Apache Lucene open-source search software
SOLR-2342: don't let hot add/updates starve commit
Michael McCandless573ecf2e16d6
diff --git a/solr/src/java/org/apache/solr/update/DirectUpdateHandler2.java b/solr/src/java/org/apache/solr/update/DirectUpdateHandler2.javaindex 55f9ac77fc0..5106b1cb0aa 100644--- a/solr/src/java/org/apache/solr/update/DirectUpdateHandler2.java+++ b/solr/src/java/org/apache/solr/update/DirectUpdateHandler2.java@@ -91,7 +91,9 @@ public class DirectUpdateHandler2 extends UpdateHandler {public DirectUpdateHandler2(SolrCore core) throws IOException {super(core);- ReadWriteLock rwl = new ReentrantReadWriteLock();+ // Pass fairness=true so commit request is not starved+ // when add/updates are running hot (SOLR-2342):+ ReadWriteLock rwl = new ReentrantReadWriteLock(true);iwAccess = rwl.readLock();iwCommit = rwl.writeLock();