Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] ngx_upstream do not cleanup file buffers in subrequest

Maxim Dounin
March 09, 2011 02:04PM
Hello!

On Wed, Mar 09, 2011 at 01:46:56PM -0500, magz wrote:

> Maxim Dounin Wrote:
> -------------------------------------------------------
> > Hello!
> >
> > On Tue, Mar 08, 2011 at 03:24:47PM -0500, magz
> > wrote:
> >
> > > Hello,
> > >
> > > Is it reasonable to add following check to not
> > clean/discard fd in case
> > > if it's sub request?
> > >
> > > I developed nginx module and when it started to
> > use tmp buffers under
> > > load I had following error:
> > >
> > > 29663#0: *45789 sendfile() failed (9: Bad file
> > descriptor) while
> > > sending request to upstream, client: 10.1.24.14,
> > server: hss, request:
> > > "POST
> > >
> > > So that sub-request cleared file before main
> > request reached it.
> > > Probably this bug should not appear if request
> > body was discarded for
> > > sub request. But in case if you need request
> > body for sub-request you
> > > should be sure that sub-request does not erases
> > main request buffers.
> >
> > In official nginx, subrequests can't appear before
> > main
> > request.
> >
> > On the other hand, main request may clear body as
> > well, and it
> > won't be available for subrequests as a result.
> > This problem may
> > be easily seen with ssi module. The other
> > possible case when this
> > problem may appear is filter finalization (e.g. as
> > done by image
> > filter module).
> >
> > That is, just disabling body cleanup for
> > subrequests is clearly
> > not enough.
> >
> > I've already posted the patch which removes the
> > code in question
> > at all (as a reply to some real problems seen with
> > ssi and POSTs,
> > somewhere in russian mailing list). Probably it
> > should be made
> > controllable via some configuration directive if
> > there are some
> > real use cases which may be seriously affected by
> > removing this
> > code. I would like to hear something from Igor
> > about this.
> >
> > BTW, just for history: the code in question was
> > introduced in
> > nginx 0.3.3 with the following log message:
> >
> > *) Bugfix: a temporary file with client
> > request body now is removed
> > just after the response header was
> > transferred to a client.
> >
> > Maxim Dounin
> >
>
> additional flag to ngx_http_subrequest() has to work for this issue.

Additional flag to ngx_http_subrequest() can't help if you aren't
even going to execute subrequests (as in filter finalization case)
and can't help with ssi either, as subrequests are executed after
main request already cleared request body.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

[PATCH] ngx_upstream do not cleanup file buffers in subrequest

magz March 08, 2011 03:24PM

Re: [PATCH] ngx_upstream do not cleanup file buffers in subrequest

Maxim Dounin March 09, 2011 06:20AM

Re: [PATCH] ngx_upstream do not cleanup file buffers in subrequest

magz March 09, 2011 01:46PM

Re: [PATCH] ngx_upstream do not cleanup file buffers in subrequest

magz March 09, 2011 02:22PM

Re: [PATCH] ngx_upstream do not cleanup file buffers in subrequest

magz March 09, 2011 02:28PM

Re: [PATCH] ngx_upstream do not cleanup file buffers in subrequest

Maxim Dounin March 09, 2011 02:04PM

Re: [PATCH] ngx_upstream do not cleanup file buffers in subrequest

magz March 09, 2011 09:55PM

Re: [PATCH] ngx_upstream do not cleanup file buffers in subrequest

Maxim Dounin March 09, 2011 07:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 188
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready