From 0e4bc2772250d05f054303bfdef2b7d82a257af9 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 23 Nov 2020 23:15:09 +0100 Subject: [PATCH] qa/tasks/ceph: resurrect log compression Commit 953662555840 ("qa/tasks/ceph: use Cluster.sh() and Remote.sh() when appropriate") dropped run.wait(), which waits for all given processes to exit. This resulted in errors like INFO:teuthology.orchestra.run.smithi107.stderr:tar: ./objectstore_tool..log: file changed as we read it INFO:teuthology.orchestra.run.smithi107.stderr:tar: ./ceph-client.admin.175125.log: File removed before we read it as the task moved on to archiving semi-corrupted and uncompressed logs, filling up the lab cluster. Revert that hunk, as Cluster.sh() is useless here -- we don't need stdout or stderr, but very much need parallel execution and wait for the compression to finish. Signed-off-by: Ilya Dryomov --- qa/tasks/ceph.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 50173b4bb8e0f..701b51be04f9e 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -255,10 +255,27 @@ def ceph_log(ctx, config): not (ctx.config.get('archive-on-error') and ctx.summary['success']): # and logs log.info('Compressing logs...') - ctx.cluster.sh( - 'sudo find /var/log/ceph -name *.log -print0 | ' - 'sudo xargs -0 --no-run-if-empty -- gzip --', - wait=False) + run.wait( + ctx.cluster.run( + args=[ + 'sudo', + 'find', + '/var/log/ceph', + '-name', + '*.log', + '-print0', + run.Raw('|'), + 'sudo', + 'xargs', + '-0', + '--no-run-if-empty', + '--', + 'gzip', + '--', + ], + wait=False, + ), + ) log.info('Archiving logs...') path = os.path.join(ctx.archive, 'remote') -- 2.39.5