launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #04329
Re: Proof-of-concept 'forking' lp-serve
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> On 17 August 2010 11:48, Michael Hudson <michael.hudson@xxxxxxxxxxxxx> wrote:
>>>>> The last is a bit of an approximation, because my test front end hack
>>>>> uses select.poll() over file descriptors, and doesn't seem to be getting
>>>>> POLLHUP on any of the fifos.
>>>> I don't entirely understand the consequence of this :-)
>>> So the big takeaway is 2.4s => 0.08s.
>> I understood that bit! :-)
>>
>>> There is some concern that we won't easily detect when the smart
>>> server is finished going this route. As I at least wasn't seeing it
>>> disconnect from the fifo (echo foo > script, sends a POLLHUP event to
>>> select when the input is finished, I wasn't seeing that when lp-serve
>>> on the other side of a fifo finished.)
>> Ah, I see.
>
> According to the poll(2) manpage and my rusty understanding, you get
> POLLHUP only when the remote end closes a socket you're trying to
> write to, and probably only if this causes you to lose
> already-buffered data. If the client closes a socket you're trying to
> read from, I would expect you to get POLLIN and then find an EOF, or
> to get POLLRDHUP (which may not be exposed in Python.)
>
> It's great to see this coming along.
Well, I *am* getting it when stdin finishes. I do have some code that
says "if event & POLLIN and not bytes" (if I got the POLLIN event but
there was no content) consider the connection closed. But I don't seem
to be getting that.
Which is also weird because 'cat /.../fifo' finishes correctly.
Anyway, ideally I wouldn't need the proxy in the middle, and just have
that done in the twisted code.
I'm still a little concerned about detecting process lifetimes and exit
codes (if they matter to twisted), since this process isn't a direct
child. Should I be trying to convey that information via another channel?
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkxqmRMACgkQJdeBCYSNAAN1igCgyDrqtU8rHUAC0sYy5lXy3nb6
1qMAmwYkGWk/Yg4wsvvz01KC07aIw3p4
=Sf4U
-----END PGP SIGNATURE-----
Follow ups
References