I have a script which is using Paramiko to SSH into a server and is querying some files on the order of a few times a second. Occasionally it will crash with a TimeOut error message with seeming no obvious pattern in how long into the runtime this occurs. When I try to debug and look for potential lulls in activity that might be causing a timeout I find that the script seems to be sending and receiving messages at a pretty uniform rate right up until the moment the error occurs, and with no obvious anomalies in the messages that are being passed before the connection breaks. It seems to happen no matter what timeout argument I pass the initial connection too
Is there something obvious I'm missing here that might be causing this? Unsure what would be useful sample code to provide in this case but happy to edit with more details if needed. Thanks!!
EDIT:
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(-credentials-)
while True:
stdin, stdout, stderr = client.exec_command(command)
data = stdin.readlines()
print(data)
Over-simplified example of the kind of loop that my code runs that seems to run into timeout errors without warning