← Back to team overview

launchpad-dev team mailing list archive

Re: Proof-of-concept 'forking' lp-serve

 

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.
-- 
Martin



Follow ups

References