Skip to content

Commit

Permalink
fix to remove annoying message ( as it was introduced in previous PR )
Browse files Browse the repository at this point in the history
under the stress conditions we are getting onNext( 0 bytes ), onComplete
AFTER we say subscriber.onCompleted() and tiered down and close request stream.

see PR for further clarification
  • Loading branch information
maksimlikharev committed Apr 29, 2015
1 parent 631fd4d commit cd409a9
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ public void onError(Throwable e) {
public void onNext(ByteBuf byteBuf) {
lock.lock();
try {
contentBuffer.writeBytes( byteBuf );

//This is not only to stop writing 0 bytes as it might seems
//In case of no payload request, like GET
//We are getting onNext( 0 bytes ), onComplete during the stress conditions
//AFTER we say subscriber.onCompleted() and tiered down and close
//request stream, this doesn't contradict logic, in fact 0 bytes is just the same as nothing to write
//but that save us annoying log record every time this happens
if( byteBuf.readableBytes() > 0 ) {
contentBuffer.writeBytes( byteBuf );
}

contentAvailabilityMonitor.signalAll();
}
Expand Down

0 comments on commit cd409a9

Please sign in to comment.