mirror of https://github.com/apache/druid.git
Add flush prior to close on output stream in QueryResource
This commit is contained in:
parent
6763e3780a
commit
69bbe21512
|
@ -183,6 +183,7 @@ public class QueryResource
|
||||||
{
|
{
|
||||||
// json serializer will always close the yielder
|
// json serializer will always close the yielder
|
||||||
jsonWriter.writeValue(outputStream, yielder);
|
jsonWriter.writeValue(outputStream, yielder);
|
||||||
|
outputStream.flush(); // Some types of OutputStream suppress flush errors in the .close() method.
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
|
|
||||||
final long queryTime = System.currentTimeMillis() - start;
|
final long queryTime = System.currentTimeMillis() - start;
|
||||||
|
@ -213,7 +214,7 @@ public class QueryResource
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
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();
|
yielder.close();
|
||||||
throw Throwables.propagate(e);
|
throw Throwables.propagate(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue