prevent that long-running deletion tasks block a hard commit.

pull/1/head
Michael Peter Christen 12 years ago
parent bb4bf3d8fd
commit 70e981b333

@ -206,10 +206,17 @@ public class ConcurrentUpdateSolrConnector implements SolrConnector {
public void commit(boolean softCommit) { public void commit(boolean softCommit) {
this.connector.commit(softCommit); this.connector.commit(softCommit);
if (!softCommit) { if (!softCommit) {
long timeout = System.currentTimeMillis() + 1000;
ensureAliveDeletionHandler(); ensureAliveDeletionHandler();
while (this.deleteQueue.size() > 0) try {Thread.sleep(10);} catch (InterruptedException e) {} while (this.deleteQueue.size() > 0) {
try {Thread.sleep(10);} catch (InterruptedException e) {}
if (System.currentTimeMillis() > timeout) break;
}
ensureAliveUpdateHandler(); ensureAliveUpdateHandler();
while (this.updateQueue.size() > 0) try {Thread.sleep(10);} catch (InterruptedException e) {} while (this.updateQueue.size() > 0) {
try {Thread.sleep(10);} catch (InterruptedException e) {}
if (System.currentTimeMillis() > timeout) break;
}
} }
} }

Loading…
Cancel
Save