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: [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]