diff --git a/src/aiida/transports/plugins/ssh.py b/src/aiida/transports/plugins/ssh.py index 773c1f51fc..7035290a61 100644 --- a/src/aiida/transports/plugins/ssh.py +++ b/src/aiida/transports/plugins/ssh.py @@ -1318,7 +1318,7 @@ def _exec_command_internal(self, command, combine_stderr=False, bufsize=-1): return stdin, stdout, stderr, channel - def exec_command_wait_bytes(self, command, stdin=None, combine_stderr=False, bufsize=-1): + def exec_command_wait_bytes(self, command, stdin=None, combine_stderr=False, bufsize=-1, timeout=0.01): """Executes the specified command and waits for it to finish. :param command: the command to execute @@ -1327,6 +1327,7 @@ def exec_command_wait_bytes(self, command, stdin=None, combine_stderr=False, buf :param combine_stderr: (optional, default=False) see docstring of self._exec_command_internal() :param bufsize: same meaning of paramiko. + :param timeout: ssh channel timeout for stdout, stderr. :return: a tuple with (return_value, stdout, stderr) where stdout and stderr are both bytes and the return_value is an int. @@ -1374,8 +1375,8 @@ def exec_command_wait_bytes(self, command, stdin=None, combine_stderr=False, buf # if compression is enabled). # It's important to mention that, for speed benchmarks, it's important to disable compression # in the SSH transport settings, as it will cap the max speed. - stdout.channel.settimeout(0.01) - stderr.channel.settimeout(0.01) # Maybe redundant, as this could be the same channel. + stdout.channel.settimeout(timeout) + stderr.channel.settimeout(timeout) # Maybe redundant, as this could be the same channel. while True: chunk_exists = False