-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci-operator/step-registry/ipi: Shuffle installer log gathering #7936
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,21 @@ set -o nounset | |
set -o errexit | ||
set -o pipefail | ||
|
||
trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM | ||
|
||
cluster_profile=/var/run/secrets/ci.openshift.io/cluster-profile | ||
export AWS_SHARED_CREDENTIALS_FILE=$cluster_profile/.awscred | ||
export AZURE_AUTH_LOCATION=$cluster_profile/osServicePrincipal.json | ||
|
||
echo "Deprovisioning cluster ..." | ||
cp -ar "${SHARED_DIR}" /tmp/installer | ||
openshift-install --dir /tmp/installer destroy cluster | ||
cp /tmp/installer/.openshift_install.log "${ARTIFACT_DIR}/" | ||
openshift-install --dir /tmp/installer destroy cluster & | ||
|
||
set +e | ||
wait "$!" | ||
ret="$?" | ||
set -e | ||
|
||
cp /tmp/installer/.openshift_install.log "${ARTIFACT_DIR}" | ||
|
||
exit "$ret" | ||
Comment on lines
-13
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking about this the other day, would creating symlinks before executing the installer work in these cases? We could then drop this type of logic from this and other steps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Might work for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is the intent of this to continue even if it fails? If so, it's racy -- you can have the background fail before you
set +e
. Why are we doing this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
errexit
, even withpipefail
, considers background processes. I can't find a positive reference, but:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. And capture the backgrounded command's exit status so we can return it later on.
Indeed. As described in the PR topic comment, this approach is recycled from de3de20 (#6708). But testing locally with
false &
, I can produce your race. Will reroll to handle log collection viatrap
to avoid the race.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to background it to get
trap
TERM handling; see 4472ace (#2680).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I thought I'd reproduced the race in a shell earlier, but trying to nail this down for a commit message I'm having trouble:
Can you provide an example that exposes the race?