We encountered an issue with ChunkedWriteHandler (netty version 3.5.7).
We get StackOverflowError in following scenario:
- ChunkWriteHandler.queue is not empty
- ChunkedWriteHandler.currentEvent is not null and it stores ChunkedInput as message
- chunkedInput stored in currentEvent is in suspended mode (nextChunk returns null but isEndOfInput returns false).
In such case break from while loop in line 248 is executed.
But then immediately after that flush() is called again recursively in line 301, because condition in line 300 evaluates to true.
If chunkedInput is in suspended mode long enough we get StackOverFlowException.
As a fix I moved suspend variable above while loop and modified condition in line 300 to:
if (acquired && (!channel.isConnected() || channel.isWritable() && (!queue.isEmpty() && !suspend))) {
I am not exactly sure if it does not break something but it seems to fix an issue.
We encountered an issue with ChunkedWriteHandler (netty version 3.5.7).
We get StackOverflowError in following scenario:
In such case break from while loop in line 248 is executed.
But then immediately after that flush() is called again recursively in line 301, because condition in line 300 evaluates to true.
If chunkedInput is in suspended mode long enough we get StackOverFlowException.
As a fix I moved suspend variable above while loop and modified condition in line 300 to:
I am not exactly sure if it does not break something but it seems to fix an issue.