Skip to content

Commit 3384101

Browse files
committed
buildkite hooks: Run cleanup script once
Timeout causes SIGINT signal -> cleanup function runs -> cleanup function calls exit() -> EXIT signal -> cleanup function runs Noticed in https://buildkite.com/materialize/nightly/builds/13959#019a471f-8649-4463-a473-68bbab4f5d32
1 parent 5c32aef commit 3384101

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

ci/plugins/cloudtest/hooks/command

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ cleanup() {
185185
sudo systemctl restart docker
186186
docker ps --all --quiet | xargs --no-run-if-empty docker rm --force --volumes
187187

188+
# Don't run the cleanup function twice
189+
trap - EXIT SIGTERM SIGINT
188190
exit "$CI_ANNOTATE_ERRORS_RESULT"
189191
}
190192

ci/plugins/mzcompose/hooks/command

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ cleanup() {
350350
exit 1
351351
fi
352352

353+
# Don't run the cleanup function twice
354+
trap - EXIT SIGTERM SIGINT
353355
exit "$CI_ANNOTATE_ERRORS_RESULT"
354356
}
355357

0 commit comments

Comments
 (0)