Hello,
On one server running hunchentoot quite often the following error occurs:
23: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #) 24: (INVOKE-DEBUGGER #) 25: (ERROR SB-BSD-SOCKETS:NOT-CONNECTED-ERROR)[:EXTERNAL] 26: (SB-BSD-SOCKETS:SOCKET-ERROR "getpeername") 27: ((SB-PCL::FAST-METHOD SB-BSD-SOCKETS:SOCKET-PEERNAME (SB-BSD-SOCKETS:SOCKET)) # # #) 28: ((SB-PCL::FAST-METHOD USOCKET:GET-PEER-ADDRESS (USOCKET:STREAM-USOCKET)) # # #) 29: (HUNCHENTOOT::CLIENT-AS-STRING #) 30: ((SB-PCL::FAST-METHOD HUNCHENTOOT:HANDLE-INCOMING-CONNECTION (HUNCHENTOOT:ONE-THREAD-PER-CONNECTION-TASKMASTER T)) ..) 31: ((SB-PCL::FAST-METHOD HUNCHENTOOT:ACCEPT-CONNECTIONS (HUNCHENTOOT:ACCEPTOR)) # # #) 32: ((LAMBDA ()))
As you see, it happens in USOCKET:GET-PEER-ADDRESS called in HANDLE-INCOMING-CONNECTION before the request handling thread is started.
This exception breaks the main loop in ACCEPT-CONNECTIONS and server doesn't handle HTTP requests anymore.
Most probably these errors are very rare in general, but on this particular machine they happen constantly.
Adding ignore-errors to the loop helps - the server doesn't hang anymore.
Best regard, - Anton
P.S. The problem and the fix suggested are discovered by Andrey Moskvitin, I am just reporting it here.