Skip to content

Commit 5aad6c5

Browse files
committed
ci: fix exit 75 retry by adding explicit retry config to all base templates
GitLab CI does not support exit_codes in the default: keyword (job-level only). As a result, the exit_codes: [75] in generate-common.php's default: block was silently ignored, so jobs exiting 75 (e.g. kafka not ready in wait-for-service-ready.sh) were never retried. Fix: - Add retry_on_infra_failure() helper to generate-common.php to centralize the retry config (max 2, infra failure conditions, exit_codes: [75]) - Apply it to all child pipeline base templates: .base_test (tracer), .verify_job (package), .appsec_test (appsec), .tea_test (shared) - PHP Language Tests explicit retry gains exit_codes: [75] back, which it was losing by overriding the default: block
1 parent 96c5f06 commit 5aad6c5

5 files changed

Lines changed: 23 additions & 0 deletions

File tree

.gitlab/generate-appsec.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
.appsec_test:
4444
tags: [ "arch:${ARCH}" ]
4545
interruptible: true
46+
<?php retry_on_infra_failure() ?>
4647
rules:
4748
- if: $CI_COMMIT_BRANCH == "master"
4849
interruptible: false

.gitlab/generate-common.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,23 @@ function windows_git_setup_with_packages() {
9999
<?php
100100
}
101101

102+
function retry_on_infra_failure() {
103+
?>
104+
retry:
105+
max: 2
106+
when:
107+
- unknown_failure
108+
- data_integrity_failure
109+
- runner_system_failure
110+
- scheduler_failure
111+
- api_failure
112+
- stuck_or_timeout_failure
113+
- job_execution_timeout
114+
exit_codes:
115+
- 75
116+
<?php
117+
}
118+
102119
?>
103120
default:
104121
retry:

.gitlab/generate-package.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@
967967
DD_AGENT_HOST: request-replayer
968968
DD_TRACE_AGENT_PORT: 80
969969
DD_TRACE_AGENT_FLUSH_INTERVAL: 1000
970+
<?php retry_on_infra_failure() ?>
970971
script:
971972
- ./dockerfiles/verify_packages/verify.sh
972973

.gitlab/generate-shared.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
stage: test
101101
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-7"
102102
interruptible: true
103+
<?php retry_on_infra_failure() ?>
103104
rules:
104105
- if: $CI_COMMIT_BRANCH == "master"
105106
interruptible: false

.gitlab/generate-tracer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ function before_script_steps($with_docker_auth = false) {
190190
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-7
191191
timeout: 60m
192192
interruptible: true
193+
<?php retry_on_infra_failure() ?>
193194
rules:
194195
- if: $CI_COMMIT_BRANCH == "master"
195196
interruptible: false
@@ -518,6 +519,8 @@ function before_script_steps($with_docker_auth = false) {
518519
- api_failure
519520
- stuck_or_timeout_failure
520521
- job_execution_timeout
522+
exit_codes:
523+
- 75
521524
script:
522525
- make install_all
523526
- export XFAIL_LIST="dockerfiles/ci/xfail_tests/${PHP_MAJOR_MINOR}.list"

0 commit comments

Comments
 (0)