-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make pipeline handler behave better when removed (#1080)
Motivation: The HTTPServerPipelineHandler is removed from pipelines in many cases, but the most common case is over upgrade. While the handler is removable, it doesn't make any effort to ensure that it leaves the pipeline in a sensible state, which is pretty awkward. In particular, there are 3 things the pipeline handler may be holding on to that can lead to damage. The first is pipelined requests: if there are any, they should be delivered, as the user may be deliberately allowing pipelining. The second thing is read() calls. The HTTPServerPipelineHandler exerts backpressure on clients that aggressively pipeline by refusing to read from the socket. If that happens, and then the handler is removed from the channel, it will "forget" to restart reading from the socket on the way out. That leaves the channel quietly in a state where no reads will occur ever again, which is pretty uncool. The third thing is quiescing. The HTTPServerPipelineHandler catches quiescing events and allows them to deliver a response before closing a connection. If that has happened when the pipeline handler is removed, it should fall back to the behaviour as though it were not there. Modifications: - Added a handlerRemoved implementation to play event state that should be replayed. - Added a channelInactive implementation to drop data. Result: More graceful handler removal.
- Loading branch information
Showing
3 changed files
with
279 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.