Maxim Dounin
October 27, 2009 09:44AM
Hello!

On Tue, Oct 27, 2009 at 06:42:06PM +0800, agentzh wrote:

> On Tue, Oct 27, 2009 at 5:41 PM, agentzh <agentzh@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? :)

Could you please try to produce reduced code that triggers the issue?

I don't really have much time to investigate your module code,
but I believe the problem is that you use subrequests and recall
content handlers in mostly arbitrary way. E.g. it looks like you
call content handler again from post_subrequest handler. This
isn't supposed to work - they are normally called in quite a
different contexts and have very different expectations. Probably
some changes in 0.8.21 rendered your code to be completely
invalid.

Maxim Dounin
Subject Author Posted

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)

agentzh October 27, 2009 06:48AM

Re: 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 October 27, 2009 09:44AM

Re: 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)

agentzh October 28, 2009 12:32AM

Re: 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)

agentzh October 28, 2009 12:48AM

Re: 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)

agentzh October 28, 2009 05:20AM

Re: 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)

agentzh October 28, 2009 05:20AM

Re: 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 October 28, 2009 06:18AM

Re: 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)

agentzh October 28, 2009 10:44PM

Re: 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)

agentzh November 18, 2009 11:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 304
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