Error handling from filter modules
Maxim Dounin
mdounin at mdounin.ru
Tue Oct 20 02:00:47 UTC 2015
Hello!
On Mon, Oct 19, 2015 at 11:02:53PM +0100, Steven Hartland wrote:
[...]
> >When the NGX_ERROR case is triggered, no response is returned, the
> >connection is just closed.
> It does seem like the connection to the client is just closed however a 206
> response is logged for the request in the access log, hence my confusion; is
> that expected?
Yes. Once set, status code will be logged even if an error occurs
later.
> >As this expected to happen if and only
> >if we weren't able to allocate memory, this is believed to be
> >perfectly correct behaviour. Trying to do anything else is very
> >unlikely to succeed, but likely to result in additional problems.
> >
> In the current code yes, but in the patch that I was testing there's one
> additional case which can return an error. This was caused by an intentional
> configuration error (test designed to confirm the behaviour in this case).
>
> Its likely going to be difficult to discuss fully without the patch to
> comment against so I'll finalise that and get it posted as soon as I can.
General recommendation is to avoid cases when you have to return
error pages from filter modules. But yes, it's difficult to
disscuss without the code.
--
Maxim Dounin
http://nginx.org/
More information about the nginx-devel
mailing list