jandre / serf

Automatically exported from code.google.com/p/serf
Apache License 2.0
0 stars 0 forks source link

Cancel a request if an error response is seen early #92

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
While talking with breser about error handling on the server for PUT requests, 
I thought of something cool we could do:

Consider a 1 gigabyte PUT request, and *while* we are transferring that data, a 
500 response comes back. If we're using a chunked request, then we could simply 
terminate the request.

(if the request is using C-L, then we'd need to finish the request, or close 
the connection mid-request)

Not exactly sure how to implement this within serf's model. Somehow, the 
chunk_bucket needs to learn of the error and terminate the request stream.

Original issue reported on code.google.com by gstein on 14 Nov 2012 at 6:34

GoogleCodeExporter commented 9 years ago
Issue 91 is related to this, it's specifically about 4xx responses, but it 
requires the same 'handling an early response and aborting the associated 
request' mechanism to work.

Original comment by lieven.govaerts@gmail.com on 14 Nov 2012 at 7:31

GoogleCodeExporter commented 9 years ago
gstein: can you check if r1694 resolves this issue? In your scenario, the 
request will be destroyed after the application has handled the response, so we 
stop sending the rest of it.

I do expect the server in such cases to include a Connection: Close header in 
the response, so we always start with a clean connection for the next request.

Original comment by lieven.govaerts@gmail.com on 17 Nov 2012 at 8:44