Commit d6870c2b authored by Shinya Maeda's avatar Shinya Maeda Committed by Stan Hu

Do not auto-retry unrecoverable job failure

Currently, the system tries to auto-retry jobs
that failed by 'missing_dependency_failure',
however, this failure is not recoverable.

This commit force-overrides the auto-retry
maximum on the specific failure.
parent 72485b12
......@@ -841,10 +841,6 @@
"const": "runner_system_failure",
"description": "Retry if there is a runner system failure (for example, job setup failed)."
},
{
"const": "missing_dependency_failure",
"description": "Retry if a dependency is missing."
},
{
"const": "runner_unsupported",
"description": "Retry if the runner is unsupported."
......
......@@ -3405,7 +3405,6 @@ Possible values for `when` are:
- `api_failure`: Retry on API failure.
- `stuck_or_timeout_failure`: Retry when the job got stuck or timed out.
- `runner_system_failure`: Retry if there is a runner system failure (for example, job setup failed).
- `missing_dependency_failure`: Retry if a dependency is missing.
- `runner_unsupported`: Retry if the runner is unsupported.
- `stale_schedule`: Retry if a delayed job could not be executed.
- `job_execution_timeout`: Retry if the script exceeded the maximum execution time set for the job.
......
......@@ -9,7 +9,8 @@ class Gitlab::Ci::Build::AutoRetry
RETRY_OVERRIDES = {
ci_quota_exceeded: 0,
no_matching_runner: 0
no_matching_runner: 0,
missing_dependency_failure: 0
}.freeze
def initialize(build)
......
......@@ -24,6 +24,7 @@ RSpec.describe Gitlab::Ci::Build::AutoRetry do
"default for scheduler failure" | 1 | {} | :scheduler_failure | true
"quota is exceeded" | 0 | { max: 2 } | :ci_quota_exceeded | false
"no matching runner" | 0 | { max: 2 } | :no_matching_runner | false
"missing dependencies" | 0 | { max: 2 } | :missing_dependency_failure | false
end
with_them do
......
......@@ -101,7 +101,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Retry do
api_failure
stuck_or_timeout_failure
runner_system_failure
missing_dependency_failure
runner_unsupported
stale_schedule
job_execution_timeout
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment