Re: [Filterproxy-devel] Re: FilterProxy BUG
Brought to you by:
mcelrath
From: Guillaume M. <gui...@mo...> - 2002-05-07 15:45:03
|
Dans un message du 07 May à 9:48, Bob McElrath écrivait : > Well I'm stumped. And bugs I can't reproduce are very hard to debug. :( I know, even I can reproduce it, I can't fix it :-) > 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? It is Linux 2.2.14 (tried too with .19) and glibc 2.1.3. Getpeername can return undef, if the syscall fails (here with ENOTCONN). If the peer has shutdown the connection, it looks logical to me. > 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. Yes, but accept(2) can't fail for other reasons that you should test such as ECONNRESET. After the getpeername error, I get EPIPE, I tried to launch accept again, it seems to trigger endless EPIPE errors. I do not know if you should ignore that one ... But there is surely a list of accept(2) errors that you want to ignore. > 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 = undef; > $daemon = new HTTP::Daemon LocalAddr => $HOSTNAME, > LocalPort => $LISTEN_PORT, > Reuse => 1, Listen => 40 > or croak "HTTP::Daemon failed to initialize: $!\n" > . "Is $HOSTNAME:$LISTEN_PORT correct?"; > The latter is copied from around line 189. Yes I'd prefer to fix it too. Unfortunately, This does not work since the port is already bound. I tried to do a $daemon->close before that, but it did not help. > 4) I just noticed the 'Listen => 40' paremter above. The man page > says: > Listen Queue size for listen > try increasing it? Unfortunately, it does not change the behavior :-( > 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 => 1' parameter? I tried, but since Linux does not have the SO_REUSEPORT socket options. There is no changes :-( Anyway, thanks a lot for your help. Regards, -- Guillaume Morin <gui...@mo...> I am the saddest kid in grade number two (Lisa Simpsons) |