SOLR-2192: sync runners in StreamingUpdateSolrServer.blockUntilFinished

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1026882 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2010-10-24 20:41:32 +00:00
parent 9c7336c45c
commit 40214cf103
1 changed files with 6 additions and 3 deletions

View File

@ -244,11 +244,14 @@ public class StreamingUpdateSolrServer extends CommonsHttpSolrServer
lock = new CountDownLatch(1);
try {
// Wait until no runners are running
Runner runner = runners.peek();
while( runner != null ) {
for(;;) {
Runner runner;
synchronized(runners) {
runner = runners.peek();
}
if (runner == null) break;
runner.runnerLock.lock();
runner.runnerLock.unlock();
runner = runners.peek();
}
} finally {
lock.countDown();