Skip to content

Commit

Permalink
fix read hang
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongqiangczq committed Aug 28, 2023
1 parent 41b60eb commit d550637
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,6 @@ public FileInfo getFileInfo() {
public void closeReader() {
synchronized (lock) {
readFinished = true;
// old client can't support BufferStreamEnd, so for new client it tells client that this
// stream is finished.
if (!isLegacy) associatedChannel.writeAndFlush(new BufferStreamEnd(streamId));
}
logger.debug("Closed read for stream {}", this.streamId);
}
Expand Down Expand Up @@ -443,6 +440,9 @@ public void release() {
synchronized (lock) {
if (!isReleased) {
logger.debug("release reader for stream {}", streamId);
// old client can't support BufferStreamEnd, so for new client it tells client that this
// stream is finished.
if (!isLegacy) associatedChannel.writeAndFlush(new BufferStreamEnd(streamId));
if (!buffersToSend.isEmpty()) {
numInUseBuffers.addAndGet(-1 * buffersToSend.size());
buffersToSend.forEach(RecyclableBuffer::recycle);
Expand Down

0 comments on commit d550637

Please sign in to comment.