From 573ecf2e16d618785d04871c5b61e29073eef5d5 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Mon, 14 Feb 2011 22:56:35 +0000 Subject: [PATCH] SOLR-2342: don't let hot add/updates starve commit git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1070691 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/java/org/apache/solr/update/DirectUpdateHandler2.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solr/src/java/org/apache/solr/update/DirectUpdateHandler2.java b/solr/src/java/org/apache/solr/update/DirectUpdateHandler2.java index 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();