Code review comment for lp:~jameinel/launchpad/lp-serve-child-hangup

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2/16/2011 5:43 PM, Martin Pool wrote:
> On 17 February 2011 10:01, Robert Collins <email address hidden> wrote:
>> On Thu, Feb 17, 2011 at 11:38 AM, John A Meinel <email address hidden> wrote:
>>> I would expect something similar from dup2.
>>
>> I would expect dup2 to workaround those bugs :) - its why I suggested it.
>
> We want to do a nonblocking open, so we don't have an fd to dup until
> we've done that.
>
> After opening it, maybe we could dup it, then make the new copy
> blocking, then close the original. It's possible that would work
> around it. On the other hand if in general we can't make open fds
> blocking, it may not fix it.
>

Right, it *might* work to, open non-blocking, set it to blocking, then
dup2 it and use the new duplicated one. I can try it, but honestly, the
code is much clearer with the Timer rather than the
blocking/non-blocking dance. I have to write a loop that times out, etc.
Rather than just getting a SIG* after 120s of inactivity.

If you prefer SIGALRM, or alarm(2), then we can use ctypes/pyrex/whatever.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1dN90ACgkQJdeBCYSNAAP5nwCgkPAFSuCwQP6+l96tNXjB1PAP
XBQAnj5JBVESjYtPmxJiz13EZ7iJeAt3
=KHsN
-----END PGP SIGNATURE-----

« Back to merge proposal