From a0b2a63d7fe9e3f23a378ca84d17fbed35eccee7 Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Tue, 16 Dec 2014 18:32:41 -0800 Subject: [PATCH] Fix deadlock in DirectDruidClient --- .../java/io/druid/client/DirectDruidClient.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/server/src/main/java/io/druid/client/DirectDruidClient.java b/server/src/main/java/io/druid/client/DirectDruidClient.java index 3e562457248..67613773ac9 100644 --- a/server/src/main/java/io/druid/client/DirectDruidClient.java +++ b/server/src/main/java/io/druid/client/DirectDruidClient.java @@ -214,15 +214,12 @@ public class DirectDruidClient implements QueryRunner @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); } } }