Conversation
The current patch set cleanly terminates the chunked response in case of a mid-response error, which is not what we want. Instead we want to skip the final empty chunk and ensure that the socket is closed on the way out. I think we can accomplish the latter by setting |
Will fix; was up late. |
New code looks quite good. I think I'd add an access log entry in the |
"" -> {ok, Resp1}; | ||
_ -> send_delayed_chunk(Resp1, FirstChunk) | ||
end, | ||
send_delayed_chunk(Resp2, Chunk); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this clause be written more simply?
{ok, Resp} = StartFun(Req, Code, Headers),
send_delayed_chunk(Resp, [FirstChunk, Chunk]);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, got this straight from Paul's original, wasn't focused on brevity there. Will fix.
If we start a response too early we can't respond with errors appropriately. This delays the start of the response until we have heard back from the cluster that there's at least one message to send the client. Errors that occur before any message result in a response that has the correct 500 status code. Errors that occur after a response has started are handled by sending nothing and closing the connection. Thanks Paul Davis and Bob Dionne. BugzID: 12438
This patch delays sending a _list response until the first row of the view has been consumed. Errors that occur before that event result in a response that has the correct 500 status code. Errors that occur after a response has started are handled by sending nothing and closing the connection. BugzID: 12438
BugzID: 12438
@rnewson, does the rebased patch set work for you? One for views introducing the setup, one for _list, one for tests, one for logging. |
No description provided.