From 85de30ae589b61d2489a6c06babf3e7ca2d776d3 Mon Sep 17 00:00:00 2001 From: Douglas RAILLARD Date: Tue, 20 Aug 2019 15:43:24 +0100 Subject: [PATCH] lisa.wlgen.rta: Fix race condition in RTA workload execution The rtapp JSON config file is pushed to the target in RTA.__init__, but is only used when RTA.run() is called. Since the name is not unique, something else could have modified the file in between, leading to the wrong workload to be executed. Fix that by prepending a UUID to the remote filename, so that there is a one-to-one mapping between remote conf files and RTA() instances. --- lisa/wlgen/rta.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisa/wlgen/rta.py b/lisa/wlgen/rta.py index b82afe37c..deffc5618 100644 --- a/lisa/wlgen/rta.py +++ b/lisa/wlgen/rta.py @@ -22,6 +22,7 @@ import re import sys from collections import OrderedDict import copy +import uuid from lisa.wlgen.workload import Workload from lisa.utils import Loggable, ArtifactPath, TASK_COMM_MAX_LEN @@ -63,7 +64,8 @@ class RTA(Workload): json_file = '{}.json'.format(self.name) self.local_json = ArtifactPath.join(self.res_dir, json_file) - self.remote_json = self.target.path.join(self.run_dir, json_file) + remote_json_file = '{}_{}'.format(uuid.uuid4(), json_file) + self.remote_json = self.target.path.join(self.run_dir, remote_json_file) rta_cmd = self.target.which('rt-app') if not rta_cmd: -- GitLab