summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2020-11-20 09:20:14 +0000
committerKarolin Seeger <kseeger@samba.org>2021-03-03 10:13:11 +0000
commitbebe69c35256bbd2a2e7e038d137c21930e88acf (patch)
treed2f3ff37a2c1aaa45a8b16570113a056ec3b98a0
parent00df0473da5d5e80ce97baa7efd0db3316d4eb90 (diff)
downloadsamba-bebe69c35256bbd2a2e7e038d137c21930e88acf.tar.gz
script/autobuild.py: let cleanup() ignore errors from rmdir_force() by default
It's not useful to generate a python backtrace from within the cleanup code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14628 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 9883ac45939f253a63f3ff312fc3912c5f02cdac) Autobuild-User(v4-14-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-14-test): Tue Feb 2 10:29:44 UTC 2021 on sn-devel-184 (cherry picked from commit cc1568be4d4250390a9ad03c84f5e260fc7acffd)
-rwxr-xr-xscript/autobuild.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/script/autobuild.py b/script/autobuild.py
index 6436a55b7d8..b1a1b4800d1 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -1022,14 +1022,23 @@ class buildlist(object):
self.tail_proc = Popen(cmd, close_fds=True)
-def cleanup():
+def cleanup(do_raise=False):
if options.nocleanup:
return
run_cmd("stat %s || true" % test_tmpdir, show=True)
run_cmd("stat %s" % testbase, show=True)
do_print("Cleaning up %r" % cleanup_list)
for d in cleanup_list:
- rmdir_force(d)
+ ok = rmdir_force(d, re_raise=False)
+ if ok:
+ continue
+ if os.path.isdir(d):
+ do_print("Killing, waiting and retry")
+ run_cmd("killbysubdir %s > /dev/null 2>&1" % d, checkfail=False)
+ else:
+ do_print("Waiting and retry")
+ time.sleep(1)
+ rmdir_force(d, re_raise=do_raise)
def daemonize(logfile):
@@ -1295,7 +1304,7 @@ while True:
(status, failed_task, failed_stage, failed_tag, errstr) = blist.run()
if status != 0 or errstr != "retry":
break
- cleanup()
+ cleanup(do_raise=True)
except Exception:
cleanup()
raise