sjstein / tpMonitor

Python monitor script to connect to tpServer
0 stars 0 forks source link

tpClient crashes on network loss #35

Closed sjstein closed 4 years ago

sjstein commented 4 years ago

During a router reboot, the following error was noted:

20200525 00:19:06 [WARN] Timeout waiting for server response. {tpMonitor.py} Traceback (most recent call last): File "tpMonitor.py", line 101, in data = s.recv(1024) ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

Add exceptclause to catch, delay, and retry connection until either success or user interrupt.

sjstein commented 4 years ago

This error can be kind of be recreated by halting the server process while the client is running, however yields a different error:

Traceback (most recent call last): File "tpMonitor.py", line 94, in s.sendall(MSG_READ_ALL) ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

It appears the first error noted in the original issue comment happened while the client was waiting for a message, wherein the message in this comment happened while the client was attempting to send the query

sjstein commented 4 years ago

See documentation for ConnectionError:

exception ConnectionError A base class for connection-related issues.

Subclasses are BrokenPipeError, ConnectionAbortedError, ConnectionRefusedError and ConnectionResetError.