Skip to content

Commit bd1126d

Browse files
committed
CI: Stop MAD perftest server before printing its log
A failed run leaves behind a zombie server container: docker_stop_srv cats the log before docker stop, and when the log is missing the cat aborts the script (set -e) before the stop runs. Being a detached container, the zombie survives the build and keeps the MAD agent registration on the HCA, so every following build's server fails with EINVAL and the client hangs until the job timeout - the stage breaks for all PRs until the zombie is removed by hand. Stop the container first and sweep zombie ucx_perftest_* containers before starting a new server, so one bad run cannot wedge the stage.
1 parent ed0bc4d commit bd1126d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

buildlib/tools/test_mad.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ docker_run_srv() {
3636
local test_name="$1"
3737
HCA=$(detect_active_ib_hca)
3838
sudo chmod 777 /dev/infiniband/umad*
39+
# A stale server from a previous run holds the MAD agent registration
40+
# on the HCA and makes every new server fail with EINVAL
41+
docker ps -aq --filter "name=ucx_perftest_" | xargs -r docker rm -f
3942
docker run \
4043
--rm \
4144
--detach \
@@ -53,8 +56,9 @@ docker_run_srv() {
5356

5457
docker_stop_srv() {
5558
local test_name="$1"
56-
cat "${PWD}/ucx_perf_srv_${test_name}_${BUILD_BUILDID}.log"
59+
# Stop first so a missing log cannot leave a zombie server container
5760
docker stop ucx_perftest_"$BUILD_BUILDID" || true
61+
cat "${PWD}/ucx_perf_srv_${test_name}_${BUILD_BUILDID}.log" || true
5862
}
5963

6064
set_vars() {

0 commit comments

Comments
 (0)