Repository navigation
Report read errors correctly - #479
Merged
Merged
Conversation
GET_Value and POST_Value sent the success response headers before fetching any data, then caught every error from the fetch so they could still finish the response. A read that failed on the data node therefore came back as: - a JSON read: 200 with an empty body - a binary read with a Content-Length: 200, then fewer bytes than promised, which clients report as a broken connection - a streamed read without a Content-Length (queries, variable-length types): 200 and a normally terminated body containing whatever pages were written before the failure. In testing, a query over a dataset with a bad chunk returned 2000 of its 4000 bytes as a success. Both handlers now fetch before sending headers, and any errors there propagate. A failure on a later page can't change the status, so the handler raises instead of ending the stream, and aiohttp drops the connection so that the client sees an incomplete transfer instead of a complete-looking short one. JSON serialization errors also happen before the headers now, where they used to be swallowed the same way.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GET_Value and POST_Value sent the success response headers before fetching any data, then caught every error from the fetch so they could still finish the response. A read that failed on the data node therefore came back as:
Both handlers now fetch before sending headers, and any errors there propagate. A failure on a later page can't change the status, so the handler raises instead of ending the stream, and aiohttp drops the connection so that the client sees an incomplete transfer instead of a complete-looking short one. JSON serialization errors also happen before the headers now, where they used to be swallowed the same way.