Closed solexious closed 11 years ago
This is just because SimpleHTTPServer is single-threaded and there isn't a supervisor. Using Apache/wsgi will prevent this taking out the server, but the device still needs a watchdog.
Could port it to eventlet/gevent fairly easily, which will allow for nonblocking polling of the device.
Yup, that'll work too, but the device will still need a watchdog in case the network goes down.
Will work on bug that prevented use of the watchdog on the device
Not a bug
Been running an acnode on my home network for ~4days just pinging to check its status. Came in this morning to find it had gone into "no network/server mode" trying to make http requests to the server via a browser timed out and doing a ctrl+c managed to bring it back to life with a trace route spat out. (this also brought the acnode back to life)
192.168.5.13 - - [01/May/2012 12:45:57] "GET /1/status/ HTTP/1.0" 200 - 2012-05-01 12:45:57,070 DEBUG Time taken: 0.737 ms ^C---------------------------------------- Exception happened during processing of request from ('192.168.5.13', 1915) 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/lib/python2.7/SocketServer.py", line 639, in init self.handle() File "/usr/lib/python2.7/BaseHTTPServer.py", line 343, in handle self.handle_one_request() File "/usr/lib/python2.7/BaseHTTPServer.py", line 313, in handle_one_request self.raw_requestline = self.rfile.readline(65537) File "/usr/lib/python2.7/socket.py", line 476, in readline data = self._sock.recv(self._rbufsize)
KeyboardInterrupt