summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2019-01-21 13:45:41 +0000
committerMonty Taylor <mordred@inaugust.com>2019-01-21 14:17:44 +0000
commitf711df69789ca239260c80e506ef57eeccbf4b60 (patch)
tree4e14276624497fd6cf3274f1b8d4c6d15933fa39
parentc0a1ebb310df67ffd718b2740ac6cd7e5fa18808 (diff)
Fix concurrency and syntax issue in merge-output-to-logs
In a multi-node job, these mv commands run in parallel which makes the second invocation weird and racy (even though there is a mv -f there) Put in run_once - we don't need to perform this more than one time, no matter how many nodes there are in the nodeset. Also, when there are actually files present, if ! $(ls work_dir/*) winds up expanding as a command to be run. Change-Id: Ia59c604d6639fab762fae5e53790da8992437587
Notes
Notes (review): Code-Review+2: Jens Harbott (frickler) <j.harbott@x-ion.de> Code-Review+2: Paul Belanger <pabelanger@redhat.com> Workflow+1: Monty Taylor <mordred@inaugust.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 21 Jan 2019 16:14:55 +0000 Reviewed-on: https://review.openstack.org/632092 Project: openstack-infra/zuul-jobs Branch: refs/heads/master
-rw-r--r--roles/merge-output-to-logs/tasks/main.yaml3
1 files changed, 2 insertions, 1 deletions
diff --git a/roles/merge-output-to-logs/tasks/main.yaml b/roles/merge-output-to-logs/tasks/main.yaml
index d1fa111..a4fe8eb 100644
--- a/roles/merge-output-to-logs/tasks/main.yaml
+++ b/roles/merge-output-to-logs/tasks/main.yaml
@@ -2,7 +2,7 @@
2 when: zuul.change is defined 2 when: zuul.change is defined
3 delegate_to: localhost 3 delegate_to: localhost
4 shell: | 4 shell: |
5 if ! $(ls {{ zuul.executor.work_root }}/{{ item }}) ; then 5 if [ -n $(ls {{ zuul.executor.work_root }}/{{ item }}) ] ; then
6 # Only create target directory if it is needed. 6 # Only create target directory if it is needed.
7 # Do not fail if it is already there. 7 # Do not fail if it is already there.
8 mkdir -p {{ zuul.executor.log_root }}/{{ item }} 8 mkdir -p {{ zuul.executor.log_root }}/{{ item }}
@@ -13,3 +13,4 @@
13 loop: 13 loop:
14 - artifacts 14 - artifacts
15 - docs 15 - docs
16 run_once: true