Re: [Filterproxy-devel] Re: FilterProxy BUG
Brought to you by:
mcelrath
|
From: Guillaume M. <gui...@mo...> - 2002-05-08 09:32:54
|
Hi Bob,
Dans un message du 07 May à 13:31, Bob McElrath écrivait :
> Well, if accept() is returning undef (which is what causes the main loop
> to exit), then it's the listen socket that has failed. I believe the
> getpeername() that is failing is not the one in FilterProxy.pl, but a
> getpeername called inside the accept() method somewhere (which is buried
> in perl XS). This then causes accept() to return undef, which causes
> the main loop to exit. The getpeername() in FilterProxy.pl cannot cause
> the main loop to exit.
Nope, according to the backtraces that FilterProxy prints, the
getpeername calls are the one in FiterProxy.pl. Even if I kill the child
when getpeername returns undef, the following accept call will return
EPIPE. I do not know why. If you ignore it and just restart accept, at
some point accept will always return EPIPE.
> BTW I didn't see any getpeername syscalls in the strace you sent me. It
> just looked like accept returned ECONNRESET.
Yes, indeed it happened sometimes. This seems to have been fixed when I
upgraded to a more recent libwww-perl.
> Ok, I'll add this. But I wish it fixed your problem.
Same here :-)
> Then it seems the logical solution would be to close the Listen socket
> and start over (which you tried unsuccessfully). Perhaps close() does
> not relinquish the listening socket. Try $daemon->shutdown()? From the
> perlfunc man page:
>
> This is useful with sockets when you want to tell the other side
> you're done writing but not done reading, or vice versa. It's also a
> more insistent form of close because it also disables the file
> descriptor in any forked copies in other processes.
>
> Note that for this to work consistently, FilterProxy should kill any
> forked children. The shutdown() will probably forcibly close all
> sockets to all clients.
Hmm, I missed that method in the Perl manual. I'll try that. I've
basically implemented this in a shell script. I check if there still is
a listen socket, if not I kill all children with a killall and restart
FilterProxy.
Thanks again for your help.
Regards,
--
Guillaume Morin <gui...@mo...>
<Overfiend> canard: thanks
|