In case of temporary redirects while establishing a web socket connection, ws_client_loop stops
Agent's main loop may stop in case of temporary redirects while establishing a web socket connection, e.g. when you forgot to pay for the internet and the operator redirects all requests to some stub page. It seems to be a Tornado issue: https://github.com/tornadoweb/tornado/issues/2405
Need to find a way how to handle exceptions like the following one:
[everest_agent.agent] [INFO] [2019-10-01 05:07:58,927] Closed connection to server
[everest_agent.agent] [INFO] [2019-10-01 05:08:05,933] Connecting to server wss://everest.distcomp.org/compute/agent/v1
[tornado.application] [ERROR] [2019-10-01 05:08:05,957] Uncaught exception
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/tornado/http1connection.py", line 238, in _read_message
delegate.finish()
File "/usr/lib64/python2.7/site-packages/tornado/http1connection.py", line 671, in finish
return self._delegate.finish()
File "/usr/lib64/python2.7/site-packages/tornado/simple_httpclient.py", line 536, in finish
self.client.fetch(new_request, final_callback)
AttributeError: 'NoneType' object has no attribute 'fetch'
[tornado.application] [ERROR] [2019-10-01 05:08:05,957] Exception in callback <functools.partial object at 0x7fa8ba580470>
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/tornado/ioloop.py", line 605, in _run_callback
ret = callback()
File "/usr/lib64/python2.7/site-packages/tornado/stack_context.py", line 345, in wrapped
raise_exc_info(exc)
File "/usr/lib64/python2.7/site-packages/tornado/stack_context.py", line 316, in wrapped
ret = fn(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/tornado/simple_httpclient.py", line 431, in <lambda>
lambda f: f.result())
File "/usr/lib64/python2.7/site-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "/usr/lib64/python2.7/site-packages/tornado/gen.py", line 1069, in run
yielded = self.gen.send(value)
File "/usr/lib64/python2.7/site-packages/tornado/http1connection.py", line 238, in _read_message
delegate.finish()
File "/usr/lib64/python2.7/site-packages/tornado/http1connection.py", line 55, in __exit__
raise _QuietException
_QuietException
Edited by Sergey Smirnov