Fix deadlock in DirectDruidClient

This commit is contained in:
Charles Allen 2014-12-16 18:32:41 -08:00
parent 76cd7e0f56
commit a0b2a63d7f
1 changed files with 6 additions and 9 deletions

View File

@ -214,15 +214,12 @@ public class DirectDruidClient<T> implements QueryRunner<T>
@Override
public InputStream nextElement()
{
synchronized (done) {
try {
// Ensures more elements are expected via `done`
return queue.take();
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw Throwables.propagate(e);
}
try {
return queue.take();
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw Throwables.propagate(e);
}
}
}