[PATCH] Make ngx_http_upstream provide a way to expose errors after sending out the response header

Maxim Dounin mdounin at mdounin.ru
Thu Jul 25 16:16:15 UTC 2013


Hello!

On Tue, Apr 09, 2013 at 04:30:30AM +0400, Maxim Dounin wrote:

> On Mon, Apr 08, 2013 at 04:12:18PM -0700, agentzh wrote:
> 
> > Will you work on the patch directly? This issue keeps bothering me
> > (and of my users) for long.
> > 
> > Guessing your mind is no easy task for me and I've ended up tweaking
> > my patches over and over again without real gains ;)
> 
> I have plans to start working on upstream error handling cleanup, 
> and on this problem in particular, in about two weeks.

TWIMC, I've committed upstream error handling cleanup patch 
series, see here:

http://hg.nginx.org/nginx/rev/d3eab5e2df5f
 
(and previous 20 patches).

In case of fatal errors (like memory allocation problems and so 
on) it now just calls ngx_http_finalize_request(NGX_ERROR), which 
in turn results in a connection being closed.

If nginx detects incomplete response from an upstream server, it 
now only flushes pending data and then finalizes request normally 
without sending a last buffer.  It's a bit less radical than 
finalization with NGX_ERROR and ensures that everything we've 
got from an upstream server is sent to a client.

-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx-devel mailing list