Welcome! Log In Create A New Profile

Advanced

Re: ngx_http_request_t's subrequests is what meaning be?

Maxim Dounin
July 02, 2010 04:52AM
Hello!

On Fri, Jul 02, 2010 at 11:03:20AM +0800, BoBo wrote:

> thanks , but now nginx use what to avoid subrequests cycle?
>
> I think your patch doesn't avoid subrequests cycle, because the certain may
> call ngx_http_subrequest again finalize request(the newest subrequest), and
> then cause subrequests cycle.
>
> so i think should remove r->main->subrequests++.

Removing r->main->subrequests++ completely will limit total number
of subrequests to NGX_HTTP_MAX_SUBREQUESTS. This isn't intended
(and will cause problems in many configurations, e.g. in the thread
I linked it exceeded 255 without any loops).

Limit on number of subrequests was always meant to limit number of
simulteneously executing subrequests, and this is what currently
causes problems (due to r->main->count overflow and resulting
SIGSEGV).

In general, I see three options on how to handle this:

1. Resurrect r->main->subrequests limit as in patch linked.

2. Drop r->main->subrequests limit and check for r->main->count
overflows intead.

3. Drop r->main->subrequests limit and introduce something like
subrequest recursion counter to limit depth of subrequests, not
it's count. This implies (2) or bumping r->main->count to
some bigger datatype to avoid overflows.

Maxim Dounin

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

ngx_http_request_t's subrequests is what meaning be?

BoBo July 01, 2010 08:16AM

Re: ngx_http_request_t's subrequests is what meaning be?

BoBo July 01, 2010 08:38AM

Re: ngx_http_request_t's subrequests is what meaning be?

Maxim Dounin July 01, 2010 10:18AM

Re: ngx_http_request_t's subrequests is what meaning be?

BoBo July 01, 2010 11:08PM

Re: ngx_http_request_t's subrequests is what meaning be?

Maxim Dounin July 02, 2010 04:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 126
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready