[Web-SIG] how to test hunging socket ?

William Dode wilk at flibuste.net
Sat Jan 31 20:53:35 CET 2009


I think i finaly could catch the error...

With wsgiref simple_server (and apache mod_proxy), i run an app without 
problem most of the time. I mean 100000 hits/day. Some times, not every 
day, the app freeze and i need to restart it manualy. If i don't the app 
stay like that and never answer more to requests.

The traceback show a lot broken pipe. This traceback is repeated for 
each requests to the restart.

Traceback (most recent call last):
  File "/usr/lib/python2.5/wsgiref/handlers.py", line 93, in run
    self.finish_response()
  File "/usr/lib/python2.5/wsgiref/handlers.py", line 134, in finish_response
    self.write(data)
  File "/usr/lib/python2.5/wsgiref/handlers.py", line 217, in write
    self.send_headers()
  File "/usr/lib/python2.5/wsgiref/handlers.py", line 273, in send_headers
    self.send_preamble()
  File "/usr/lib/python2.5/wsgiref/handlers.py", line 199, in send_preamble
    'Date: %s\r\n' % format_date_time(time.time())
  File "/usr/lib/python2.5/socket.py", line 274, in write
    self.flush()
  File "/usr/lib/python2.5/socket.py", line 261, in flush
    self._sock.sendall(buffer)
error: (32, 'Broken pipe')

I know that wsgiref should not be used in production, but i'm suprised 
that a broken pipe can freeze all the app...

-- 
William Dodé - http://flibuste.net
Informaticien Indépendant



More information about the Web-SIG mailing list