On Tue, Oct 27, 2009 at 5:41 PM, agentzh [email protected] 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?
Thanks!
-agentzh