Welcome! Log In Create A New Profile

Advanced

Re: Strange behavior with custom module and http proxy

Brian Bruns
December 21, 2009 12:08PM
Hi Piotr,

The (grand)child process does some things asynchronously from the
module and I'm basically using the double fork to know when the
grandchild is up and running (when execv() returns, I know its
initialized and running). I then make a unix socket connection to it
and pass some data back and forth. The (grand)child SIGALRM's and
exits after a timeout period (60 seconds) unless it's reattached to
and reused. Curiously, if I bring up the child manually (nginx module
not doing the fork/exec) then everything works fine. Also if a second
nginx worker attaches subsequently, it works. It is only the act of
the fork which seems to invoke the problem. It's almost as if nginx
is doing a wait() for the child before closing the request, although I
know the child has been reaped earlier and the grandchild is now a
child of init.

Like I said, I only noticed the behavior when using http proxy
caching, so the problem has existed for me all along without my being
aware of it.

Brian

2009/12/21 Piotr Sikora <piotr.sikora@frickle.com>:
> Hi Brian,
> it's hard to tell what goes wrong just from your description, but could you
> explain what's the reason behind double-fork() & reparenting child process?
>
> I've recently made a module (to be released *soon*) which also fork()s and I
> didn't notice such behavior.
>
> Best regards,
> Piotr Sikora < piotr.sikora@frickle.com >
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

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

Strange behavior with custom module and http proxy

Brian Bruns December 21, 2009 11:22AM

Re: Strange behavior with custom module and http proxy

Piotr Sikora December 21, 2009 11:40AM

Re: Strange behavior with custom module and http proxy

Brian Bruns December 21, 2009 12:08PM

Re: Strange behavior with custom module and http proxy

Piotr Sikora December 21, 2009 01:52PM

Re: Strange behavior with custom module and http proxy

Brian Bruns December 21, 2009 03:34PM

Re: Strange behavior with custom module and http proxy

Brian Bruns December 21, 2009 11:30PM

Re: Strange behavior with custom module and http proxy

Piotr Sikora December 22, 2009 08:48AM

Re: Strange behavior with custom module and http proxy

Brian Bruns December 22, 2009 11:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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