EventReceiverFirehose: Drain buffer when closed, until empty.

This commit is contained in:
Gian Merlino 2015-10-27 18:07:06 -07:00
parent 6305dfe1b9
commit 36569094ce
1 changed files with 4 additions and 1 deletions

View File

@ -207,8 +207,11 @@ public class EventReceiverFirehoseFactory implements FirehoseFactory<MapInputRow
{ {
synchronized (readLock) { synchronized (readLock) {
try { try {
while (!closed && nextRow == null) { while (nextRow == null) {
nextRow = buffer.poll(500, TimeUnit.MILLISECONDS); nextRow = buffer.poll(500, TimeUnit.MILLISECONDS);
if (closed) {
break;
}
} }
} }
catch (InterruptedException e) { catch (InterruptedException e) {