Welcome! Log In Create A New Profile

Advanced

Re: Strange behavior with custom module and http proxy

Brian Bruns
December 21, 2009 11:30PM
Hi Piotr,

I have created a (very) small module that demonstrates the problem.
It can be downloaded here:

http://www.mediafire.com/?yij1tmyjzyz

I've included a README on how to set up the module, and how to
reproduce the problem.

So, if I open the URL http://localhost:4242/bogus/a it returns right away.

If I open http://localhost:4242/cache/bogus/b which goes through the
http proxy caching it hangs for 30 seconds until the child process
(bogochild) exits after sleeping.

Also, I did test not forking in the child (which basically makes the
child a "sleep 30") with a small adjustment to the module (removing
the waitpid) and the problem still persists.

Thanks again for the help!

Brian

2009/12/21 Brian Bruns <brian@bruns.com>:
> That is the confusing part to me.  SIGCHLD is called on the death of
> the parent but not the death of the grandchild (correctly) and the
> signal handler with waitpid() is called immediately, not after the 60
> second delay.
>
> The module is destined to be released but I'm not quite ready for it
> just yet.  I will roll up a minimal module that replicates the
> behavior and post that.
>
> Thank you for the help.
>
> Brian
>
> 2009/12/21 Piotr Sikora <piotr.sikora@frickle.com>:
>>> 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.
>>
>> It is indeed calling waitpid() after receiving SIGCHLD, but this shouldn't
>> be a problem. Could you check if this happens also with single-fork()
>> (without spawning grandchild)?
>>
>>> 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.
>>
>> If you don't want to share your module, could you make module with minimal
>> functionality which reproduces this 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: 140
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