af26826348
In Netty 3, downstream writes of SPDY data frames and upstream reads of SPDY window udpate frames occur on different threads. When receiving a window update frame, we synchronize on a java object (SpdySessionHandler::flowControlLock) while sending any pending writes that are now able to complete. When writing a data frame, we check the send window size to see if we are allowed to write it to the socket, or if we have to enqueue it as a pending write. To prevent races with the window update frame, this is also synchronized on the same SpdySessionHandler::flowControlLock. In Netty 4, upstream and downstream operations on any given channel now occur on the same thread. Since java locks are re-entrant, this now allows downstream writes to occur while processing window update frames. In particular, when we receive a window update frame that unblocks a pending write, this write completes which triggers an event notification on the response, which in turn triggers a write of a data frame. Since this is on the same thread it re-enters the lock and modifies the send window. When the write completes, we continue processing pending writes without knowledge that the window size has been decremented. |
||
---|---|---|
.. | ||
DefaultSpdyDataFrame.java | ||
DefaultSpdyGoAwayFrame.java | ||
DefaultSpdyHeaders.java | ||
DefaultSpdyHeadersFrame.java | ||
DefaultSpdyPingFrame.java | ||
DefaultSpdyRstStreamFrame.java | ||
DefaultSpdySettingsFrame.java | ||
DefaultSpdyStreamFrame.java | ||
DefaultSpdySynReplyFrame.java | ||
DefaultSpdySynStreamFrame.java | ||
DefaultSpdyWindowUpdateFrame.java | ||
package-info.java | ||
SpdyCodecUtil.java | ||
SpdyDataFrame.java | ||
SpdyFrame.java | ||
SpdyFrameCodec.java | ||
SpdyFrameDecoder.java | ||
SpdyFrameDecoderDelegate.java | ||
SpdyFrameEncoder.java | ||
SpdyGoAwayFrame.java | ||
SpdyHeaderBlockDecoder.java | ||
SpdyHeaderBlockEncoder.java | ||
SpdyHeaderBlockJZlibEncoder.java | ||
SpdyHeaderBlockRawDecoder.java | ||
SpdyHeaderBlockRawEncoder.java | ||
SpdyHeaderBlockZlibDecoder.java | ||
SpdyHeaderBlockZlibEncoder.java | ||
SpdyHeaders.java | ||
SpdyHeadersFrame.java | ||
SpdyHttpCodec.java | ||
SpdyHttpDecoder.java | ||
SpdyHttpEncoder.java | ||
SpdyHttpHeaders.java | ||
SpdyHttpResponseStreamIdHandler.java | ||
SpdyOrHttpChooser.java | ||
SpdyPingFrame.java | ||
SpdyProtocolException.java | ||
SpdyRstStreamFrame.java | ||
SpdySession.java | ||
SpdySessionHandler.java | ||
SpdySessionStatus.java | ||
SpdySettingsFrame.java | ||
SpdyStreamFrame.java | ||
SpdyStreamStatus.java | ||
SpdySynReplyFrame.java | ||
SpdySynStreamFrame.java | ||
SpdyVersion.java | ||
SpdyWindowUpdateFrame.java |