Skip to content

Commit 5065555

Browse files
committed
ci: exit 75 on kafka port-open to guarantee retry on broker unreadiness
nc -z only verifies TCP connectivity, not that the Kafka broker is ready to handle requests. Returning 0 on a successful nc -z check was a false positive: the job would proceed, tests would fail with exit code 1, and the exit_codes: 75 retry would never trigger. Also add exit_codes: 75 to the PHP Language Tests explicit retry block, which was overriding the default: retry from generate-common.php and dropping the exit_codes condition.
1 parent 96c5f06 commit 5065555

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

.gitlab/generate-common.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ function windows_git_setup_with_packages() {
104104
retry:
105105
max: 2
106106
when:
107+
- script_failure
107108
- unknown_failure
108109
- data_integrity_failure
109110
- runner_system_failure

.gitlab/generate-tracer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,8 @@ function before_script_steps($with_docker_auth = false) {
518518
- api_failure
519519
- stuck_or_timeout_failure
520520
- job_execution_timeout
521+
exit_codes:
522+
- 75
521523
script:
522524
- make install_all
523525
- export XFAIL_LIST="dockerfiles/ci/xfail_tests/${PHP_MAJOR_MINOR}.list"

.gitlab/wait-for-service-ready.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ wait_for_single_service() {
5151
fi
5252
;;
5353
kafka)
54-
# Kafka readiness via nc check + settle time
54+
# nc -z only verifies TCP connectivity, not broker readiness.
55+
# Exit 75 (EX_TEMPFAIL) to trigger CI retry instead of proceeding
56+
# with a false-positive "ready" signal.
5557
if timeout 5 nc -z "${HOST}" "${PORT}" 2>/dev/null; then
56-
sleep 5 # Additional settle time for Kafka
57-
echo "Kafka is ready"
58-
return 0
58+
echo "Kafka port is open but broker readiness unverified; signalling retry"
59+
exit 75
5960
fi
6061
;;
6162
redis)

0 commit comments

Comments
 (0)