PeteLawler / BeagleBrew

A Beaglebone Black fork of a Raspberry Pi Temperature Controller for homebrewing and sous vide cooking
1 stars 1 forks source link

Flask crashes out on browser close #43

Closed PeteLawler closed 7 years ago

PeteLawler commented 7 years ago

Sometimes the Flask server crashes out on browser close, thus requiring (afaik) a complete app restart. This has been bugging me for some time and I finally got a trace!

> 
> Sep 06 14:24:21  python[2714]: Traceback (most recent call last):
> Sep 06 14:24:21  python[2714]:   File "/opt/BeagleBrew/beaglebrew.py", line 555, in <module>
> Sep 06 14:24:21  python[2714]:     app.run(use_reloader=False, host='0.0.0.0')
> Sep 06 14:24:21  python[2714]:   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 843, in run
> Sep 06 14:24:21  python[2714]:     run_simple(host, port, self, **options)
> Sep 06 14:24:21  python[2714]:   File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 694, in run_simple
> Sep 06 14:24:21  python[2714]:     inner()
> Sep 06 14:24:21  python[2714]:   File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 659, in inner
> Sep 06 14:24:21  python[2714]:     srv.serve_forever()
> Sep 06 14:24:21  python[2714]:   File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 499, in serve_forever
> Sep 06 14:24:21  python[2714]:     HTTPServer.serve_forever(self)
> Sep 06 14:24:21  python[2714]:   File "/usr/lib/python2.7/SocketServer.py", line 233, in serve_forever
> Sep 06 14:24:21  python[2714]:     self._handle_request_noblock()
> Sep 06 14:24:21  python[2714]:   File "/usr/lib/python2.7/SocketServer.py", line 292, in _handle_request_noblock
> Sep 06 14:24:21  python[2714]:     self.handle_error(request, client_address)
> Sep 06 14:24:21  python[2714]:   File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
> Sep 06 14:24:21  python[2714]:     self.process_request(request, client_address)
> Sep 06 14:24:21  python[2714]:   File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
> Sep 06 14:24:21  python[2714]:     self.finish_request(request, client_address)
> Sep 06 14:24:21  python[2714]:   File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
> Sep 06 14:24:22  python[2714]:     self.RequestHandlerClass(request, client_address, self)
> Sep 06 14:24:22  python[2714]:   File "/usr/lib/python2.7/SocketServer.py", line 654, in __init__
> Sep 06 14:24:22  python[2714]:     self.finish()
> Sep 06 14:24:22  python[2714]:   File "/usr/lib/python2.7/SocketServer.py", line 713, in finish
> Sep 06 14:24:22  python[2714]:     self.wfile.close()
> Sep 06 14:24:22  python[2714]:   File "/usr/lib/python2.7/socket.py", line 283, in close
> Sep 06 14:24:22  python[2714]:     self.flush()
> Sep 06 14:24:22  python[2714]:   File "/usr/lib/python2.7/socket.py", line 307, in flush
> Sep 06 14:24:22  python[2714]:     self._sock.sendall(view[write_offset:write_offset+buffer_size])
> Sep 06 14:24:22  python[2714]: socket.error: [Errno 32] Broken pipe
> 
PeteLawler commented 7 years ago

Oh, that above may be the normal closing of a page and I couldn't reconnect because I was trying the wrong development machine. Still, it'd be nice to work out why it spews the above out along with tracking the crash...

PeteLawler commented 7 years ago

Duplicate of #29