xvrl commented on code in PR #12032:
URL: https://github.com/apache/druid/pull/12032#discussion_r941094948


##########
core/src/main/java/org/apache/druid/java/util/http/client/response/SequenceInputStreamResponseHandler.java:
##########
@@ -56,18 +56,15 @@ public class SequenceInputStreamResponseHandler implements 
HttpResponseHandler<I
   @Override
   public ClientResponse<InputStream> handleResponse(HttpResponse response, 
TrafficCop trafficCop)
   {
-    try (ChannelBufferInputStream channelStream = new 
ChannelBufferInputStream(response.getContent())) {
-      queue.put(channelStream);
-    }
-    catch (IOException e) {
-      throw new RuntimeException(e);
+    try {
+      // add empty initial buffer since SequenceInputStream will peek the 
first element right away
+      queue.put(new ByteBufInputStream(Unpooled.EMPTY_BUFFER)); // lgtm 
[java/input-resource-leak]
     }
     catch (InterruptedException e) {
-      log.error(e, "Queue appending interrupted");
+      log.warn(e, "Thread interrupted while taking from queue");

Review Comment:
   no, I mostly left that as since we had the stack trace before, happy to 
remove it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to