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
This commit is contained in:
Michael McCandless 2011-02-14 22:56:35 +00:00
parent 8c6f28451a
commit 573ecf2e16
1 changed files with 3 additions and 1 deletions

View File

@ -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();