Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  22 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Liming Zhao  
View profile  
 More options Apr 27 2012, 11:21 am
From: Liming Zhao <limingz...@gmail.com>
Date: Fri, 27 Apr 2012 08:21:26 -0700 (PDT)
Local: Fri, Apr 27 2012 11:21 am
Subject: Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?
I am only using subprocess as an example for demonstrate SIGCHLD.

import gevent, subprocess
def run():
    proc = subprocess.Popen(['sleep', '1'])
    while proc.poll() is None:
        gevent.sleep()
    return proc.poll()
gevent.joinall([gevent.spawn(run)])

This will hang because os.waitpid cannot receive SIGCHLD.
strace shows that:
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGCHLD, {0x2b7f0f1c01c0, ~[RTMIN RT_1], SA_RESTORER|
SA_RESTART, 0x333040eb10}, NULL, 8) = 0

changing the code to the following makes it work.
import gevent, subprocess
def run():
    import signal
    signal.signal(signal.SIGCHLD, signal.SIG_DFL)
    proc = subprocess.Popen(['sleep', '1'])
    while proc.poll() is None:
        gevent.sleep()
    return proc.poll()
gevent.joinall([gevent.spawn(run)])

In fact, import signal; signal.signal(signal.SIGCHLD, signal.SIG_DFL)
is only needed once once the eventloop starts.

Thanks,


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis Bilenko  
View profile  
 More options Apr 27 2012, 2:24 pm
From: Denis Bilenko <denis.bile...@gmail.com>
Date: Fri, 27 Apr 2012 22:24:10 +0400
Local: Fri, Apr 27 2012 2:24 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?
It's not a bug, the child watchers were added in 1.0b2 and when those
are enabled makes libev reap all children.

It's unfortunately breaks os.waitpid. We'll have a replacement for it
that works.

This behavior can be disabled with GEVENT_BACKEND=nochild enviroment setting.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Liming Zhao  
View profile  
 More options Apr 27 2012, 2:52 pm
From: Liming Zhao <limingz...@gmail.com>
Date: Fri, 27 Apr 2012 11:52:42 -0700 (PDT)
Local: Fri, Apr 27 2012 2:52 pm
Subject: Re: Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?
Great, that works.

Thanks,

On Apr 27, 2:24 pm, Denis Bilenko <denis.bile...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Fulton  
View profile  
 More options Apr 27 2012, 2:56 pm
From: Jim Fulton <j...@zope.com>
Date: Fri, 27 Apr 2012 14:56:39 -0400
Local: Fri, Apr 27 2012 2:56 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Fri, Apr 27, 2012 at 2:24 PM, Denis Bilenko <denis.bile...@gmail.com> wrote:
> It's not a bug, the child watchers

What are child watchers?

> were added in 1.0b2 and when those
> are enabled

Are they enabled by default?

> makes libev reap all children.

> It's unfortunately breaks os.waitpid.

That's really really bad.

> We'll have a replacement for it
> that works.

A replacement for what?  Surely not os.waitpid.

> This behavior can be disabled with GEVENT_BACKEND=nochild enviroment setting.

So we have to set an environment variable to not have implicit monkey
patching of the standard library?

Jim

--
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://www.dublinstore.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthias Urlichs  
View profile  
 More options Apr 27 2012, 4:22 pm
From: Matthias Urlichs <matth...@urlichs.de>
Date: Fri, 27 Apr 2012 22:22:45 +0200
Local: Fri, Apr 27 2012 4:22 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Fri, 2012-04-27 at 14:56 -0400, Jim Fulton wrote:
> So we have to set an environment variable to not have implicit monkey
> patching of the standard library?

It's not a monkey patch, it's a save/restore of the SIGCHLD handler.
Apparently (looking at the code) it's libev which installs its own
signal handler for SIGCHLD, and setting that envvar prevents that
(by saving/restoring the 'real' signal handler around it).

Unfortunately, there is a distinct lack of comments in gevent/core.ppyx.
*Sigh*.

--
-- Matthias Urlichs


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Fulton  
View profile  
 More options May 9 2012, 6:01 pm
From: Jim Fulton <j...@zope.com>
Date: Wed, 9 May 2012 18:01:44 -0400
Local: Wed, May 9 2012 6:01 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?
Other than Matthias rightfully disagreeing with my characterization of
the signal handler as a monkey patch, I didn't see any other responses
to my questions and points.

Am I misunderstanding something? This looks like a pretty serious
issue with 1.0b2.  I'm not using it because of this.  The last thing I
saw from Denis was "It's not a bug", but I can't agree, either that or
it's a serious miss-feature.

Jim

--
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://www.dublinstore.com/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis Bilenko  
View profile  
 More options May 10 2012, 1:09 pm
From: Denis Bilenko <denis.bile...@gmail.com>
Date: Thu, 10 May 2012 21:09:52 +0400
Local: Thurs, May 10 2012 1:09 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Thu, May 10, 2012 at 2:01 AM, Jim Fulton <j...@zope.com> wrote:
> Other than Matthias rightfully disagreeing with my characterization of
> the signal handler as a monkey patch, I didn't see any other responses
> to my questions and points.

> Am I misunderstanding something? This looks like a pretty serious
> issue with 1.0b2.  I'm not using it because of this.  The last thing I
> saw from Denis was "It's not a bug", but I can't agree, either that or
> it's a serious miss-feature.

It makes no sense to avoid 1.0b2 since you can disable this feature.

It does break various subprocess implementations but the trunk already
have gevent.subprocess module so it's not a problem in practice.

We could make it disabled by default, but why? People will create
their own SIGCHLD handlers, all doing the same thing.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Fulton  
View profile  
 More options May 10 2012, 2:49 pm
From: Jim Fulton <j...@zope.com>
Date: Thu, 10 May 2012 14:49:05 -0400
Local: Thurs, May 10 2012 2:49 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Thu, May 10, 2012 at 1:09 PM, Denis Bilenko <denis.bile...@gmail.com> wrote:
> On Thu, May 10, 2012 at 2:01 AM, Jim Fulton <j...@zope.com> wrote:
>> Other than Matthias rightfully disagreeing with my characterization of
>> the signal handler as a monkey patch, I didn't see any other responses
>> to my questions and points.

>> Am I misunderstanding something? This looks like a pretty serious
>> issue with 1.0b2.  I'm not using it because of this.  The last thing I
>> saw from Denis was "It's not a bug", but I can't agree, either that or
>> it's a serious miss-feature.

> It makes no sense to avoid 1.0b2 since you can disable this feature.

My library, zc.resumelb, uses gevent. It is also used with other
applications, including some I may have no control over.  It is at
best unseemly and at worse a source of hard to debug bugs to require
use of an environment variable to prevent breakage.

> It does break various subprocess implementations but the trunk already
> have gevent.subprocess module so it's not a problem in practice.

Gevent will often be part of some larger applications.  Asking people
to change unrelated parts of their code to use something (say
zc.resumelb) that happens to use gevent is a non-starter (at lease for
zc.resumelb).

> We could make it disabled by default, but why?

So as not to cause mysterious breakage for a feature that people may
not want. Heck, I don't want it, I'm not even sure what it is. :)

I'm guessing that this is a in support of gevent subprocess.  I think
it would be fine to install the signal handler at the point that
gevent.subprocess is first used (not inmported, but actually used).

(I'm hoping that you'll tell me that that the signal handler isn't
installed unless someone actually creates a subprocess with
gevent.subprocess and that I'm just confused about the nature of the
problem. :)

> People will create
> their own SIGCHLD handlers, all doing the same thing.

I won't.  I can understand why someone woould want to use gevent to
manage subprocesses, but I don't and I want my code to be useable with
other people's code that doesn't use gevent.

Gevent isn't my world. It's just a tool I'm using.  I should be able
to use it independently of other libraries I'm using. If I can't, then
I won't use gevent.

Jim

--
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://www.dublinstore.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis Bilenko  
View profile  
 More options May 11 2012, 6:45 pm
From: Denis Bilenko <denis.bile...@gmail.com>
Date: Sat, 12 May 2012 02:45:07 +0400
Local: Fri, May 11 2012 6:45 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?
I patched libev to only install SIGCHLD handler when a child watcher
is started for the first time.

So as long as gevent.subprocess and loop.child were not used, the
subprocess libraries that rely on waitpid() should continue working.

Please try the trunk with your subprocess library and let me know if it works.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Fulton  
View profile  
 More options May 11 2012, 7:05 pm
From: Jim Fulton <j...@zope.com>
Date: Fri, 11 May 2012 19:05:05 -0400
Local: Fri, May 11 2012 7:05 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Fri, May 11, 2012 at 6:45 PM, Denis Bilenko <denis.bile...@gmail.com> wrote:
> I patched libev to only install SIGCHLD handler when a child watcher
> is started for the first time.

> So as long as gevent.subprocess and loop.child were not used, the
> subprocess libraries that rely on waitpid() should continue working.

Awesome. Thanks.

> Please try the trunk with your subprocess library and let me know if it works.

OK, I'll have to construct a case that is broken in b2 first.  My concern
was hypothetical, bases on the discussion.

For all intents and purposes, zc.resumelb is a WSGI server.  People
can plug anything into it.

Jim

--
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://www.dublinstore.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Fulton  
View profile  
 More options Jun 15 2012, 11:21 am
From: Jim Fulton <j...@zope.com>
Date: Fri, 15 Jun 2012 11:21:38 -0400
Local: Fri, Jun 15 2012 11:21 am
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Fri, May 11, 2012 at 7:05 PM, Jim Fulton <j...@zope.com> wrote:
> On Fri, May 11, 2012 at 6:45 PM, Denis Bilenko <denis.bile...@gmail.com> wrote:
>> I patched libev to only install SIGCHLD handler when a child watcher
>> is started for the first time.

>> So as long as gevent.subprocess and loop.child were not used, the
>> subprocess libraries that rely on waitpid() should continue working.

> Awesome. Thanks.

>> Please try the trunk with your subprocess library and let me know if it works.

> OK, I'll have to construct a case that is broken in b2 first. My concern
> was hypothetical, bases on the discussion.

... and somewhat confused.  It appears that the breakage only occurred
when gevent.sleep was used to avoid blocking when polling for a
sub-process to die. If waiting via blocking calls
(e.g. subprocess.call), there wasn't a problem.  Of course, blocking
calls are uncool in the gevent context, but my concern was for calls
made in (non-gevent) worker threads.

So this turns out not to have been a big deal. I do still think the
change you made is an improvement.

Thanks.

Jim

--
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://zo.pe/Kqm


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vitaly  
View profile  
 More options Jul 6 2012, 8:57 pm
From: vitaly <vitaly.krugl.nume...@gmail.com>
Date: Fri, 6 Jul 2012 17:57:56 -0700 (PDT)
Local: Fri, Jul 6 2012 8:57 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

I am still really, really troubled by the behavior of having libev reap
child processes behind the scenes.  In my module, I use gevent's signal
class to register a SIGCHLD handler (which works great!).  When gevent
calls my SIGCHILD handler, my module then calls a method in another module
(which I cannot modify) that manages processes and calls Popen.poll() to
check whether any of its processes completed.  So, the other module now
always fails to detect completion of the subprocesses that it manages.

Behind-the-scenes reaping of child processes sounds good in theory, but is
bad in practice.  Production-quality code will, in many cases, need to reap
its subprocesses explicitly in order to detect completion of specific
subprocess and get their completion status code.

Also, having to disable the reaping via special environment settings
kludges the interface and makes testing and deployment of programs more
error-prone.

Thank you,
Vitaly

P.S., Love gevent, but am very uncomfortable with this unfortunate
side-effect.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vitaly  
View profile  
 More options Jul 6 2012, 9:59 pm
From: vitaly <vitaly.krugl.nume...@gmail.com>
Date: Fri, 6 Jul 2012 18:59:39 -0700 (PDT)
Local: Fri, Jul 6 2012 9:59 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

Also, when I set GEVENT_BACKEND=nochild for my module, gevent.signal stops
working -- I no longer get SIGCHILD callbacks.  This is with gevent 1.0b2.
 I thought that GEVENT_BACKEND=nochild would only disable the
behind-the-scenes reaping of subprocesses, but it also broke
gevent.signal(SIGCHLD,...).

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis Bilenko  
View profile  
 More options Jul 7 2012, 2:31 am
From: Denis Bilenko <denis.bile...@gmail.com>
Date: Sat, 7 Jul 2012 10:31:28 +0400
Local: Sat, Jul 7 2012 2:31 am
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Sat, Jul 7, 2012 at 5:59 AM, vitaly <vitaly.krugl.nume...@gmail.com> wrote:
> Also, when I set GEVENT_BACKEND=nochild for my module, gevent.signal stops
> working -- I no longer get SIGCHILD callbacks.  This is with gevent 1.0b2.
> I thought that GEVENT_BACKEND=nochild would only disable the
> behind-the-scenes reaping of subprocesses, but it also broke
> gevent.signal(SIGCHLD,...).

Try the trunk. Here libev's child reaping is not enabled until a child
watcher or gevent.subprocess is used.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vitaly  
View profile  
 More options Jul 7 2012, 11:00 am
From: vitaly <vitaly.krugl.nume...@gmail.com>
Date: Sat, 7 Jul 2012 08:00:21 -0700 (PDT)
Local: Sat, Jul 7 2012 11:00 am
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Friday, July 6, 2012 11:31:28 PM UTC-7, Denis Bilenko wrote:

> On Sat, Jul 7, 2012 at 5:59 AM, vitaly <> wrote:
> > Also, when I set GEVENT_BACKEND=nochild for my module, gevent.signal
> stops
> > working -- I no longer get SIGCHILD callbacks.  This is with gevent
> 1.0b2.
> > I thought that GEVENT_BACKEND=nochild would only disable the
> > behind-the-scenes reaping of subprocesses, but it also broke
> > gevent.signal(SIGCHLD,...).

> Try the trunk. Here libev's child reaping is not enabled until a child
> watcher or gevent.subprocess is used.

This all kept me from sleeping well last night (really :)).  As I see it,
the problem is that features like this inadvertently break other modules.
 If a program/process leaves entirely in a 100% gevent-enabled world, then
all works great.  Unfortunately, far too many useful/necessary modules are
not gevent-enabled and won't be (ever or anytime soon).  gevent's SIGCHILD
watcher offers very handy integration with a gevent-enabled module;
however, as soon as my program makes use of such a module, it breaks other
non-gevent-enabled modules that start subprocesses and wait for their
completion via os.waitpid() or similar (e.g., from a separate thread).  

I understand that gevent/libev need to reap child processes in order to
implement gevent-compatible blocking semantics for process wait and similar
methods.  Conceptually, it would be ideal if gevent/libev would only reap
processes that were created via gevent.subprocess, and left other processes
alone. This would imply that gevent/libev would need to poll all
outstanding gevent.subprocess-created pid's via waitpid (or similar) on
every SIGCHLD dispatch instead of reaping whatever child/children actually
completed via wait3 (or similar).  This might incur some performance
penalty (I don't know the extent), but would reduce breakage of other
modules in the non-100%-gevent-enabled universe.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis Bilenko  
View profile   Translate to Translated (View Original)
 More options Jul 7 2012, 11:22 am
From: Denis Bilenko <denis.bile...@gmail.com>
Date: Sat, 7 Jul 2012 19:22:41 +0400
Local: Sat, Jul 7 2012 11:22 am
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Sat, Jul 7, 2012 at 7:00 PM, vitaly <vitaly.krugl.nume...@gmail.com> wrote:
> This all kept me from sleeping well last night (really :)).  As I see it,
> the problem is that features like this inadvertently break other modules.
> If a program/process leaves entirely in a 100% gevent-enabled world, then
> all works great.  Unfortunately, far too many useful/necessary modules are
> not gevent-enabled and won't be (ever or anytime soon).  gevent's SIGCHILD
> watcher offers very handy integration with a gevent-enabled module; however,
> as soon as my program makes use of such a module, it breaks other
> non-gevent-enabled modules that start subprocesses and wait for their
> completion via os.waitpid() or similar (e.g., from a separate thread).

You have to make a choice, either use child watchers and/or
gevent.subprocess or some other subprocess module.

> Conceptually, it would be ideal if gevent/libev would only reap
> processes that were created via gevent.subprocess, and left other processes
> alone. This would imply that gevent/libev would need to poll all outstanding
> gevent.subprocess-created pid's via waitpid (or similar) on every SIGCHLD
> dispatch instead of reaping whatever child/children actually completed via
> wait3 (or similar).  This might incur some performance penalty (I don't know
> the extent), but would reduce breakage of other modules in the
> non-100%-gevent-enabled universe.

It's not ideal, because the performance impact can be quite severe.
Here's Twisted's experience, which does handle each pid individually:
http://twistedmatrix.com/trac/ticket/2967

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vitaly  
View profile  
 More options Jul 7 2012, 11:44 am
From: vitaly <vitaly.krugl.nume...@gmail.com>
Date: Sat, 7 Jul 2012 08:44:52 -0700 (PDT)
Local: Sat, Jul 7 2012 11:44 am
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

I was afraid of that (re. performance impact), but not entirely surprised -
it must be a bunch of expensive kernel calls.  However, the Twisted link
points to an alternative that should solve this problem efficiently: "SA_SIGINFO
flag with sigaction".  This way, gevent/libev SIGCHLD handler would
discover the pid of the dead child process (from the siginfo_t arg), look
it up in a map of outstanding gevent.subprocess-created processes, and reap
it only if it was found in the map.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vitaly  
View profile  
 More options Jul 7 2012, 11:53 am
From: vitaly <vitaly.krugl.nume...@gmail.com>
Date: Sat, 7 Jul 2012 08:53:40 -0700 (PDT)
Local: Sat, Jul 7 2012 11:53 am
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Friday, July 6, 2012 11:31:28 PM UTC-7, Denis Bilenko wrote:

> On Sat, Jul 7, 2012 at 5:59 AM, vitaly <> wrote:
> > Also, when I set GEVENT_BACKEND=nochild for my module, gevent.signal
> stops
> > working -- I no longer get SIGCHILD callbacks.  This is with gevent
> 1.0b2.
> > I thought that GEVENT_BACKEND=nochild would only disable the
> > behind-the-scenes reaping of subprocesses, but it also broke
> > gevent.signal(SIGCHLD,...).

> Try the trunk. Here libev's child reaping is not enabled until a child
> watcher or gevent.subprocess is used.

If the process was spawned with GEVENT_BACKEND=nochild, I think that
gevent.signal() should throw an exception instead of silently failing to
work.  It takes time to debug it, especially if gevent.signal() was being
used by a 3rd party module.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis Bilenko  
View profile  
 More options Jul 7 2012, 4:22 pm
From: Denis Bilenko <denis.bile...@gmail.com>
Date: Sun, 8 Jul 2012 00:22:56 +0400
Local: Sat, Jul 7 2012 4:22 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Sat, Jul 7, 2012 at 7:53 PM, vitaly <vitaly.krugl.nume...@gmail.com> wrote:
>> Try the trunk. Here libev's child reaping is not enabled until a child
>> watcher or gevent.subprocess is used.

> If the process was spawned with GEVENT_BACKEND=nochild, I think that
> gevent.signal() should throw an exception instead of silently failing to
> work.  It takes time to debug it, especially if gevent.signal() was being
> used by a 3rd party module.

First, "nochild" option is removed from the trunk. Second, when does
gevent.signal() silently fails to work?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vitaly  
View profile  
 More options Jul 8 2012, 10:23 am
From: vitaly <vitaly.krugl.nume...@gmail.com>
Date: Sun, 8 Jul 2012 07:23:07 -0700 (PDT)
Local: Sun, Jul 8 2012 10:23 am
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Saturday, July 7, 2012 1:22:56 PM UTC-7, Denis Bilenko wrote:

> On Sat, Jul 7, 2012 at 7:53 PM, vitaly <> wrote:
> > If the process was spawned with GEVENT_BACKEND=nochild, I think that
> > gevent.signal() should throw an exception instead of silently failing to
> > work.  It takes time to debug it, especially if gevent.signal() was
> being
> > used by a 3rd party module.

> First, "nochild" option is removed from the trunk. Second, when does
> gevent.signal() silently fails to work?

When I turned on GEVENT_BACKEND=nochild for my program that uses gevent
1.0b2, my program stopped getting SIGCHLD callbacks from gevent.signal().

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Denis Bilenko  
View profile   Translate to Translated (View Original)
 More options Jul 8 2012, 10:35 am
From: Denis Bilenko <denis.bile...@gmail.com>
Date: Sun, 8 Jul 2012 18:35:08 +0400
Local: Sun, Jul 8 2012 10:35 am
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

On Sun, Jul 8, 2012 at 6:23 PM, vitaly <vitaly.krugl.nume...@gmail.com> wrote:
> When I turned on GEVENT_BACKEND=nochild for my program that uses gevent
> 1.0b2, my program stopped getting SIGCHLD callbacks from gevent.signal().

Try it with the trunk. If you still have the issue (and are sure
nothing else sets SIGCHLD in your program), please send me a
reproducing script.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
vitaly  
View profile  
 More options Jul 10 2012, 7:17 pm
From: vitaly <vitaly.krugl.nume...@gmail.com>
Date: Tue, 10 Jul 2012 16:17:30 -0700 (PDT)
Local: Tues, Jul 10 2012 7:17 pm
Subject: Re: [gevent] Is it a bug that gevent silently set the signal for SIGCHLD even if no monkey patch is used?

Denis -- what are your thoughts on  "SA_SIGINFO flag with sigaction" as a
solution?  It seems like this would be just as efficient as the current
solution, while at the same time avoiding interference with externally,
non-gevent-managed subprocesses in other modules used by the app.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »