From e5ac5bdb7bef964882ed282ae05d12601eb8c634 Mon Sep 17 00:00:00 2001 From: dbeltran Date: Mon, 18 Jan 2021 10:45:21 +0100 Subject: [PATCH] Migrate pick up last fix --- autosubmit/autosubmit.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/autosubmit/autosubmit.py b/autosubmit/autosubmit.py index 59a7bb4fd..4f3946de9 100644 --- a/autosubmit/autosubmit.py +++ b/autosubmit/autosubmit.py @@ -2634,13 +2634,22 @@ class Autosubmit: p.temp_dir, experiment_id), p.root_dir) try: finished = False - while not finished: - p.send_command("rsync -ah --remove-source-files " + os.path.join( - p.temp_dir, experiment_id) + " " + p.root_dir[:-5]) - if "warning: rsync" in p.get_ssh_output_err(): - pass - else: - finished = True + limit = 100 + rsync_retries = 0 + while not finished and rsync_retries < limit: # Avoid infinite loop unrealistic upper limit, only for rsync failure + finished = True + try: + p.send_command("rsync -ah --remove-source-files " + os.path.join( + p.temp_dir, experiment_id) + " " + p.root_dir[:-5]) + if "connection unexpectedly closed" in e.message or "warning: rsync" in e.message or "warning: rsync" in p.get_ssh_output_err(): + rsync_retries += 1 + finished = False + except AutosubmitError as e: + if "connection unexpectedly closed" in e.message or "warning: rsync" in e.message or "warning: rsync" in p.get_ssh_output_err(): + rsync_retries += 1 + finished = False + else: + raise p.send_command( "chmod 755 -R " + p.root_dir[:-5]) Log.result( -- GitLab