Strange behavior with custom module and http proxy

Brian Bruns brian at
Mon Dec 21 19:15:14 MSK 2009

Hi all,

I have a module I've written which, as part of its processing
fork/execs another process.  The child process forks again and exits
and the grandchild process is reparented to init and stays active for
60 seconds or longer depending.

This works just fine from the browser, scripts, etc...  The problem
comes when I front end the module with the http proxy module for
caching.  On the first (non-cached) call the request will not return
until the grandchild process dies (generally 60 seconds).

I'm at a loss as to what is causing this behavior as the grandchild as
mentioned had been reparented to init and the child process exited and
was reaped by successfully by nginx.  I've put some logging statements
in ngx_http_finalize_request() and other places and it seems like my
module is finishing immediately, and the delay occurs somewhere in the
proxy module.  I was hoping for some pointers as to architecturally
what might be happening or where might be good places to dig further.



More information about the nginx mailing list