Skip to content

[SVLS-10048] ci: retry bottlecap builds that hit the job timeout - #1495

Open
lym953 wants to merge 1 commit into
mainfrom
yiming.luo/retry-build-timeout
Open

lym953 wants to merge 1 commit into
mainfrom
yiming.luo/retry-build-timeout

Conversation

@lym953

@lym953 lym953 commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Merging PRs takes too much manual work, and the work grows with the number of PRs. The branch protection on main requires a branch to be up to date before it merges. So each merge puts every other open PR behind main. Its author must then merge main into the branch, wait for CI again, and merge before someone else does. When one person merges a stack of PRs, they repeat this for each PR.

Plan

Move merges to the Datadog MergeQueue, with the /merge comment. For each PR, the queue makes a temporary branch, mq-working-branch-*, with the latest main plus the PR. It runs CI on that branch and merges the PR only if CI passes. So the queue tests each PR against the latest main, and the author does not update the branch.

Step Why it is necessary Status
1. Run the Rust checks on the queue's branch Without this step, the queue does not run the Rust checks. #1494
2. Retry the GitLab builds that time out The queue waits for the GitLab pipeline. A build that stalls and fails at its 20-minute limit would reject the queued PR. This PR
3. A repo admin turns off "require branches to be up to date" While this rule is on, the queue does not merge a PR that is behind main. It waits with the blocker "branch behind base". A /merge on #1492 showed this. Not started
4. The team merges with /merge The queue tests each PR against the latest main, so authors do not update branches. Not started

This PR

Makes GitLab retry a build job that stalls and hits its time limit.

How often builds stall: GitLab has 8 build jobs for the extension binary. There is one for each combination of CPU type, FIPS (Federal Information Processing Standards) and Alpine Linux. From 2026-10-06 to 2026-11-04, these jobs timed out in 223 of 3964 attempts (5.6%). About a third of pipelines had at least one timeout. In a stalled job, the log stops in the middle of the compile and shows nothing until GitLab stops the job. A build that passes takes 19 minutes at most.

Why GitLab did not retry them: the job template retries a failed job up to 2 times. The comment above that setting says that the retry is there because the job "sometimes times out". But the retry applies only to the failure reasons in its list. GitLab gives these timeouts the reason job_execution_timeout, which was not in the list. On the branch of #1492, three pipelines had 4 timeouts, and GitLab retried none of them.

The change: adds job_execution_timeout to the retry list. A retry adds about 20 minutes to a pipeline that stalls. GitLab 19.1 deprecates this value and replaces it with server_timeout_running. Our GitLab server is version 18.5.7.

Testing

Steps

  1. Sent a minimal job with the new retry list to the GitLab CI lint API of this project.
  2. Sent the same job with the value not_a_reason in place of job_execution_timeout, as a control.

Result

Retry list sent to the lint API Result
With job_execution_timeout Valid
With not_a_reason Not valid: "retry when contains unknown values: not_a_reason"

The pipeline of this PR rendered the changed template, and all 8 builds passed on the first try. So a retry after a real timeout is not tested, because I cannot make a build stall on demand.

🤖 Generated with Claude Code

GitLab marks a job that exceeds its timeout with the failure reason
job_execution_timeout. The retry list had only stuck_or_timeout_failure,
so a stalled build failed without a retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Pipelines

✨ Unblock PR with BitsAI

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 2 Pipeline jobs failed

DDCI - DataDog/datadog-lambda-extension | integration-suite: [payload-size-e2e] — 🔧 Needs a code fix, caused by this PR

View more details · View in DDCI

DataDog/datadog-lambda-extension | e2e-test-status (amd64) — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 13e758d | Docs | View more details | Give us feedback!

@lym953
lym953 marked this pull request as ready for review November 5, 2026 02:22
@lym953
lym953 requested a review from a team as a code owner November 5, 2026 02:22
@lym953
lym953 requested review from litianningdatadog and a balanced review from Copilot November 5, 2026 02:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T02:23:52.095077Z 13e758d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the update enabling retries of timed-out Bottlecap builds.

No open issues 🎉

What changed in this PR

Updates the shared GitLab build template to retry Bottlecap builds that exceed their job timeout, reducing avoidable failures as the repository adopts Datadog MergeQueue.

Changes:

  • Adds job_execution_timeout to the existing retry conditions, retaining the maximum of two retries.
  • Adds a comment distinguishing job timeout failures from stuck_or_timeout_failure.
File Description
.gitlab/​templates/​pipeline.yaml.tpl Enables timeout retries for all eight extension build variants.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants