-
Notifications
You must be signed in to change notification settings - Fork 649
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pipeline handler: fix error state tracking (#595)
Motivation: @pushkarnk hit an interesting edge case that we previously mishandled and crashed. All these conditions need to be true 1. Whilst have an ongoing request (ie. outstanding response), ... 2. ... a `HTTPParserError` arrives (which we correctly queue) 3. Later the outstanding response is completed and then ... 4. ... the `HTTPServerProtocolErrorHandler` sends a .badRequest response We previously crashed. The reason we crashed is that the `HTTPServerPipelineHandler` obviously tracks state and then asserts that no response is sent for a wrong request. It does have an affordance to allow a .badRequest response for a request it couldn't parse. However this state tracking wasn't done if the error itself was enqueued for later delivery. Thanks very much @pushkarnk for the report! Modifications: instead of delivering the error directly use the `deliverOneError` function which transitions the state correctly. Result: fewer crashes & hopefully happy Pushkar
- Loading branch information
Showing
3 changed files
with
99 additions
and
2 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
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