mirror of https://github.com/apache/lucene.git
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:
parent
9c7336c45c
commit
40214cf103
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue