Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Broken pipe error in Django Nonrel when loading localhost

Running Django Nonrel, with Google App Engine 2.6.0 and Python 2.7, I'm getting this exception when trying to load for the first time localhost and localhost/admin (I expect it will happen with any page, though):

Exception happened during processing of request from ('127.0.0.1', 57011)
    Traceback (most recent call last):
      File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
        self.process_request(request, client_address)
      File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request
        self.finish_request(request, client_address)
      File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/usr/local/google_appengine/google/appengine/tools/dev_appserver.py", line 2438, in __init__
        BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
      File "/usr/lib/python2.7/SocketServer.py", line 641, in __init__
        self.finish()
      File "/usr/lib/python2.7/SocketServer.py", line 694, in finish
        self.wfile.flush()
      File "/usr/lib/python2.7/socket.py", line 303, in flush
        self._sock.sendall(view[write_offset:write_offset+buffer_size])
    error: [Errno 32] Broken pipe

Strangely enough, it only appears using Google Chrome. When using Firefox, it doesn't print any exception (or at least, I haven't been able to replicate this problem in Firefox after many tries).

Does anyone know something about this problem?.

Thanks

like image 815
Robert Smith Avatar asked Nov 11 '11 02:11

Robert Smith


1 Answers

There have been a few similar reports of race condition issues between Chrome and dev_appserver.py. The usual story is that Chrome opens multiple concurrent connections to the server, but sends a request on the second connection first. Because dev_appserver is single-threaded, the first request blocks, and the server hangs until someone gives up.

Supposedly starting Chrome with --disable-preconnect prevents this condition.

like image 136
Drew Sears Avatar answered Nov 10 '22 02:11

Drew Sears