CPS-chained subrequests with I/O interceptions no longer work in nginx 0.8.21 (Was Re: Custom event + timer regressions caused by the new release)
Maxim Dounin
mdounin at mdounin.ru
Tue Oct 27 16:02:38 MSK 2009
Hello!
On Tue, Oct 27, 2009 at 12:43:10PM +0000, Valery Kholodkov wrote:
>
> It seems that you are not completely aware how subrequests work.
>
> The Evan Miller's guide to nginx programming might help you:
>
> http://www.evanmiller.org/nginx-modules-guide-advanced.html#subrequests-sequential
This section looks, uhm, a bit obsolete for me. Things changed in
0.7.25 and it's no longer required to check anything but NGX_ERROR
returned from ngx_http_subrequest().
Maxim Dounin
> ----- agentzh <agentzh at gmail.com> wrote:
> > On Tue, Oct 27, 2009 at 5:41 PM, agentzh <agentzh at gmail.com> wrote:
> > >
> > > Sorry, the failures should be rephrased a bit:
> > >
> > > "All the regression tests for my "echo" module's echo_sleep directive
> > > that is used in subrequests chained by "post_subrequest" callback
> > > accepted by ngx_http_subrequest."
> > >
> >
> > Okay, more investigation shows that the real problem has nothing to do
> > with "sleep", custom events, nor timers. It's the chained subrequest
> > model with "I/O interceptions" that no longer works in nginx 0.8.21.
> >
> > The problem is much easier to phrase in terms of the "echo" module's directives:
> >
> > location /main {
> > echo_location /foo;
> > echo_location /sub1;
> > }
> > location /sub1 {
> > proxy_pass 'http://127.0.0.1:$server_port/foo';
> > }
> > location /foo {
> > echo $echo_request_uri;
> > }
> >
> > This is the minimal test case that I can produce. Basically, the
> > "post_subrequest" handler for the /foo subrequest issued directly by
> > /main issues a subrequest to /sub1. Then /sub1 in turn calls the
> > standard proxy module's handler to do some I/O operation. Then the
> > whole connection never terminates properly and hangs forever.
> >
> > If no I/O operation is involved, then the whole request completes
> > normally in 0.8.21, no matter it's "echo_sleep" or "proxy_pass" that
> > do the actual I/O interception.
> >
> > The "echo_location" directive and its async friend are defined in the
> > following .c file (for total 130+ lines of code only):
> >
> > http://github.com/agentzh/echo-nginx-module/blob/master/src/location.c
> >
> > Could anyone give me a handle? :)
>
> --
> Regards,
> Valery Kholodkov
>
More information about the nginx
mailing list