Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-05 Thread Glyph Lefkowitz
On Sep 4, 2014, at 11:30 PM, Adi Roiban wrote: > Since I can not create wiki pages here are my notes: I went to add you to wiki_editors, and I found that someone had already done so ;). Please go ahead and create a wiki page - perhaps under - so we

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-05 Thread Glyph Lefkowitz
On Sep 5, 2014, at 5:13 AM, exar...@twistedmatrix.com wrote: > It seems like a better API would let you say "Here is a protocol, hook its > output up to fd 0 in the process, hook fd 1 in the process up to its input. > Here is another protocol, hook fd 2 in the process up to its input" (this >

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-05 Thread Phil Mayers
On 05/09/14 13:13, exar...@twistedmatrix.com wrote: I don't. :) ProcessProtocol means you can't re-use any of your existing IProtocol implementations. Oops. On the other hand, it's possible to build this on top of ProcessProtocol and no one ever has... I do this about 3 times a year. Ye

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-05 Thread Adi Roiban
On 5 September 2014 13:13, wrote: > On 06:30 am, a...@roiban.ro wrote: [snip] >> For a new design: >> >> * I like the ProcessProtocol API > > > I don't. :) ProcessProtocol means you can't re-use any of your existing > IProtocol implementations. Oops. > > It seems like a better API would let you

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-05 Thread exarkun
On 06:30 am, a...@roiban.ro wrote: On 4 September 2014 12:59, wrote: [snip] What would be really nice is if someone collected *all* of the complaints about `spawnProcess` into one place and integrated solutions to them into a design for a replacement. :) Jean-Paul Since I can not create w

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-04 Thread Adi Roiban
On 4 September 2014 12:59, wrote: [snip] > What would be really nice is if someone collected *all* of the complaints > about `spawnProcess` into one place and integrated solutions to them into a > design for a replacement. :) > > Jean-Paul Since I can not create wiki pages here are my notes: To

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-04 Thread exarkun
On 07:26 am, a...@roiban.ro wrote: On 3 September 2014 18:55, wrote: On 03:27 pm, a...@roiban.ro wrote: On 3 September 2014 14:39, wrote: [snip] Do you have any suggestion for how the calls should be made? reactor.run(installSignalHandlers=True, installStopHandlers=False) Also note

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-04 Thread Adi Roiban
On 3 September 2014 18:55, wrote: > On 03:27 pm, a...@roiban.ro wrote: >> >> On 3 September 2014 14:39, wrote: [snip] >> Do you have any suggestion for how the calls should be made? >> >> reactor.run(installSignalHandlers=True, installStopHandlers=False) > > > Perhaps. [snip] > It might be ni

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-03 Thread exarkun
On 05:55 pm, exar...@twistedmatrix.com wrote: Gtk messes with signals too. There are confusing order-of-execution dependencies and Gtk changes subtly from release to release, re- breaking things after we fix them or changing them to be broken in a different way. So that's *why* it probably

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-03 Thread exarkun
On 03:27 pm, a...@roiban.ro wrote: On 3 September 2014 14:39, wrote: Yes. Providing more fine-grain control over signal handlers would be a fine improvement. Do you have any suggestion for how the calls should be made? reactor.run(installSignalHandlers=True, installStopHandlers=False)

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-03 Thread Adi Roiban
Just for reference: For the gkt2 reactor problem I found this bug report https://twistedmatrix.com/trac/ticket/5289 ... I guess that there is a problem with gtk2 and spawnProcess On 3 September 2014 16:27, Adi Roiban wrote: > On 3 September 2014 14:39, wrote: >> On 01:05 pm, a...@roiban.ro wrot

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-03 Thread Adi Roiban
On 3 September 2014 14:39, wrote: > On 01:05 pm, a...@roiban.ro wrote: >> >> On 2 September 2014 14:50, wrote: >>> >>> On 01:38 pm, j...@editshare.com wrote: >> [snip] Without my workaround, I continue to have the problem with the gtk2reactor. >>> >>> >>> Have you

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-03 Thread exarkun
On 01:05 pm, a...@roiban.ro wrote: On 2 September 2014 14:50, wrote: On 01:38 pm, j...@editshare.com wrote: [snip] Without my workaround, I continue to have the problem with the gtk2reactor. Have you reported this bug? Jean-Paul In my initial use case, signal handlers were not instal

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-03 Thread Adi Roiban
On 2 September 2014 14:50, wrote: > On 01:38 pm, j...@editshare.com wrote: >> [snip] >> >> Without my workaround, I continue to have the problem with the >> gtk2reactor. > > Have you reported this bug? > > Jean-Paul In my initial use case, signal handlers were not installed since I wanted a cust

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-03 Thread Justin Mazzola Paluska
On 09/02/2014 09:50 AM, exar...@twistedmatrix.com wrote: I dig deeper and I found out that since I was using reactor.run(installSignalHandlers=False) _SIGCHLDWaker was not installed. I have switched to using just reactor.run() and the process is now killed. Without my workaround, I continu

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-02 Thread exarkun
On 01:38 pm, j...@editshare.com wrote: FWIW, looking at your original code, you may also want to call your Deferreds in a reactor.callLater. I learned the hard way that if you callback a Deferred from processEnded and the callback spawns another process, your process will still be Twisted's

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-02 Thread Justin Mazzola Paluska
On 09/02/2014 09:31 AM, Adi Roiban wrote: Problem solved... see below On 2 September 2014 12:05, Justin Mazzola Paluska wrote: On 09/02/2014 05:08 AM, Adi Roiban wrote: [snip] if pid: self.processEnded(status) unregisterReapProcessHandler(pid, self)

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-02 Thread Adi Roiban
Problem solved... see below On 2 September 2014 12:05, Justin Mazzola Paluska wrote: > On 09/02/2014 05:08 AM, Adi Roiban wrote: [snip] > if pid: > self.processEnded(status) > unregisterReapProcessHandler(pid, self) > elif pid == 0: > # Twisted

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-02 Thread Justin Mazzola Paluska
On Sep 2, 2014 8:22 AM, "Akira Li" <4kir4...@gmail.com> wrote: > > Justin Mazzola Paluska writes: > > Unrelated. > > > def unstick(): > > reapAllProcesses() > > reactor.callLater(1, unstick) > > > > Why do you use `unstick` instead of `reapAllProcesses` dire

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-02 Thread Akira Li
Justin Mazzola Paluska writes: Unrelated. > def unstick(): > reapAllProcesses() > reactor.callLater(1, unstick) > Why do you use `unstick` instead of `reapAllProcesses` directly. Do you expect that `reapAllProcesses` name will be rebound in the future?

Re: [Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-02 Thread Justin Mazzola Paluska
On 09/02/2014 05:08 AM, Adi Roiban wrote: Hi, While using spawnProcess on Linux I found out that when an invalid executable is called there is a corner case in which a zombie process is left until main process exists and can not be closed. I wrote a test for this but I was not able to reproduce

[Twisted-Python] spawnProcess - reapProcess not retrying on failures

2014-09-02 Thread Adi Roiban
Hi, While using spawnProcess on Linux I found out that when an invalid executable is called there is a corner case in which a zombie process is left until main process exists and can not be closed. I wrote a test for this but I was not able to reproduce this error in isolation, event if I run the