[Filterproxy-devel] Re: FilterProxy BUG
Brought to you by:
mcelrath
From: Bob M. <mce...@dr...> - 2002-05-07 14:48:32
|
Guillaume Morin [gui...@mo...] wrote: > Hi Bob, >=20 > I tried to upgrade perl to 5.6.1. It did not change the problem. > getpeername still returns undef in some cases and this triggers an EPIPE > in accept which kills the main loop. >=20 > If you have any other ideas, please tell me. Well I'm stumped. And bugs I can't reproduce are very hard to debug. :( But here are a few suggestions: 1) If it's dying because getpeername is returning undef, why is getpeername returning undef? getpeername is a system call (/usr/include/sys/socket.h) What operating system/libc are you using? 2) $daemon->accept is returning false or undef (line 295). IO::Socket (parent of HTTP::Daemon) is supposed to return undef upon 'failure'. The only failure I can see is if the port it is binding to is closed, or timeout, and clearly the latter is not happening. Under some circumstances (timeout) IO::Socket::accept returns an error code in $@. Try printing out $@ in the "Exiting outside main loop (BUG!)" message. 3) It should be possible to work around this bug by re-initializing the HTTP::Daemon object. (But I'd rather fix it! ;) Add a big while loop around the main loop and do this at the end of it: $daemon =3D undef; $daemon =3D new HTTP::Daemon LocalAddr =3D> $HOSTNAME,=20 LocalPort =3D> $LISTEN_PORT, Reuse =3D> 1, Listen =3D> 40 or croak "HTTP::Daemon failed to initialize: $!\n" . "Is $HOSTNAME:$LISTEN_PORT correct?"; The latter is copied from around line 189. 4) I just noticed the 'Listen =3D> 40' paremter above. The man page says: Listen Queue size for listen try increasing it? 5) The man page also says that the 'Reuse' parameter is depreciated, in favor of 'ReuseAddr' and 'ReusePort'. Try setting those two to one instead, and drop the 'Reuse =3D> 1' parameter? Good Luck, -- Bob Bob McElrath (rsm...@st...)=20 Univ. of Wisconsin at Madison, Department of Physics |