From 69bbe21512e05c90f258468ae609f8d3e7a07504 Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Tue, 16 Jun 2015 11:40:56 -0700 Subject: [PATCH] Add flush prior to close on output stream in QueryResource --- server/src/main/java/io/druid/server/QueryResource.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/io/druid/server/QueryResource.java b/server/src/main/java/io/druid/server/QueryResource.java index bd859c98b88..ae084ba1af2 100644 --- a/server/src/main/java/io/druid/server/QueryResource.java +++ b/server/src/main/java/io/druid/server/QueryResource.java @@ -183,6 +183,7 @@ public class QueryResource { // json serializer will always close the yielder jsonWriter.writeValue(outputStream, yielder); + outputStream.flush(); // Some types of OutputStream suppress flush errors in the .close() method. outputStream.close(); final long queryTime = System.currentTimeMillis() - start; @@ -213,7 +214,7 @@ public class QueryResource .build(); } catch (Exception e) { - // make sure to close yieder if anything happened before starting to serialize the response. + // make sure to close yielder if anything happened before starting to serialize the response. yielder.close(); throw Throwables.propagate(e); }