You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/12/07 17:01:03 UTC

[GitHub] [druid] xvrl commented on a change in pull request #12032: Migrade Druid HttpClient from Netty 3 to 4

xvrl commented on a change in pull request #12032:
URL: https://github.com/apache/druid/pull/12032#discussion_r764193588



##########
File path: core/src/main/java/org/apache/druid/java/util/http/client/response/SequenceInputStreamResponseHandler.java
##########
@@ -102,14 +100,14 @@ public InputStream nextElement()
   @Override
   public ClientResponse<InputStream> handleChunk(
       ClientResponse<InputStream> clientResponse,
-      HttpChunk chunk,
+      HttpContent chunk,
       long chunkNum
   )
   {
-    final ChannelBuffer channelBuffer = chunk.getContent();
-    final int bytes = channelBuffer.readableBytes();
+    final ByteBuf byteBuf = chunk.content();
+    final int bytes = byteBuf.readableBytes();
     if (bytes > 0) {
-      try (ChannelBufferInputStream channelStream = new ChannelBufferInputStream(channelBuffer)) {
+      try (ByteBufInputStream channelStream = new ByteBufInputStream(byteBuf)) {

Review comment:
       @gianm I think this try-with-resources is incorrect, we don't want to be closing the stream at the end of the block, but instead let the downstream SequenceInputStream close the stream when done reading 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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org