Skip to content

chore(ci): give the incus-ci memory gate 45 min of patience - #192

Merged
Oddly merged 1 commit into
mainfrom
chore/molecule-gate-more-patient
Aug 10, 2026
Merged

chore(ci): give the incus-ci memory gate 45 min of patience#192
Oddly merged 1 commit into
mainfrom
chore/molecule-gate-more-patient

Conversation

@Oddly

@Oddly Oddly commented Aug 8, 2026

Copy link
Copy Markdown
Owner

The pre-launch capacity check in molecule/shared/create.yml has been retrying 30×30s (15 min) since the runner pool was rebuilt after the lab outage. Fine for one PR at a time, but the moment more than a couple of heavy PRs are open — beats_security, es_kibana, upgrade_multi_node, elasticsearch_diagnostics, elasticstack_default each want 8–20 GB — they lose the memory race against a swarm of 1–2 GB scenarios cycling through faster. A recent 5-PR merge sequence lit up five of those with matching "No capacity: X committed + Y needed > Z available" stdouts before we even looked at the actual test output.

Bumps retries: 30 → 90 (45 min of patience) and lifts the standard molecule.yml default timeout from 45 to 60 minutes so the gate still fails loudly with the last-attempt stdout before GitHub Actions silently cancels the job. Per-caller overrides (elasticsearch=30, modules=20) stay put — those scenarios are small and dont starve.

Summary by CodeRabbit

  • Bug Fixes
    • Increased the workflow timeout to 60 minutes.
    • Extended container startup retries, allowing up to 45 minutes for capacity to become available.
    • Updated related timing documentation for clarity.

…f 15

The pre-launch capacity check in molecule/shared/create.yml has been
retrying 30x30s (15 min) since the runner pool was rebuilt after the
lab outage. That was fine for one PR at a time; it stops working the
moment more than a couple of heavy PRs are open, because heavy
scenarios (beats_security, es_kibana, upgrade_multi_node,
elasticsearch_diagnostics, elasticstack_default) each need 8–20 GB and
lose the memory race against a swarm of 1–2 GB jobs coming through
faster. A recent 5-PR merge sequence lit up five of those with
matching "No capacity: X committed + Y needed > Z available" stdouts.

Bump to 90x30s (45 min) and lift the standard molecule.yml default
timeout from 45 to 60 min so the gate still fails loudly with the
last-attempt stdout before GitHub Actions cancels the job. The
existing per-caller overrides (elasticsearch=30, modules=20) stay
where they are — those jobs are small and don't starve.
@Oddly Oddly added the ci:run Trigger gated pull request CI label Aug 8, 2026
@github-actions github-actions Bot removed the ci:run Trigger gated pull request CI label Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Molecule workflow timeout increased from 45 to 60 minutes. The locked container launch task increased from 30 to 90 retries, extending its retry window from 15 to 45 minutes.

Changes

Molecule execution windows

Layer / File(s) Summary
Workflow timeout and container retries
.github/workflows/molecule.yml, molecule/shared/create.yml
The workflow timeout default is 60 minutes. The locked container launch task uses 90 retries and documents the 45-minute retry window.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: extending the Incus CI memory gate wait to 45 minutes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/molecule-gate-more-patient

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@molecule/shared/create.yml`:
- Around line 133-142: Update the retry handling around the capacity check and
cleanup loop in the Incus launch flow so partial containers from a failed batch
are deleted or their committed capacity is rolled back while holding the lock
before recalculating capacity. Ensure the next retry excludes resources from
earlier successful launches, allowing the capacity gate to evaluate the
remaining batch correctly.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 68cfad12-e108-4c66-be64-1430ccf4f255

📥 Commits

Reviewing files that changed from the base of the PR and between 6c2dcea and 62d0322.

📒 Files selected for processing (2)
  • .github/workflows/molecule.yml
  • molecule/shared/create.yml

Comment on lines +133 to +142
# 90 retries × 30s = 45 min. Deliberately shorter than the workflow
# timeout (60 min for the standard molecule.yml call, 180 min for
# full_stack) so the task fails loudly with the last "No capacity:
# …" stdout instead of being silently cancelled by the workflow
# timeout — that made the queue-starvation cases very hard to
# diagnose (see PR investigating the elasticsearch_roles_calculation
# / elasticstack_default post-outage hangs).
retries: 30
# / elasticstack_default post-outage hangs). Bumped from 30 after a
# sustained multi-PR CI storm evicted every heavy scenario on the
# first attempt.
retries: 90

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Make retries safe after a partial launch.

If an earlier incus launch succeeds and a later launch fails, the next retry performs the capacity check before the cleanup loop at Lines 117-119. The partial containers remain counted in committed_mb, while _needed_mb still includes the full batch. The retry can therefore fail the capacity gate on every attempt and consume all 90 retries.

Delete the expected containers or roll back partial launches while holding the lock before recalculating capacity.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@molecule/shared/create.yml` around lines 133 - 142, Update the retry handling
around the capacity check and cleanup loop in the Incus launch flow so partial
containers from a failed batch are deleted or their committed capacity is rolled
back while holding the lock before recalculating capacity. Ensure the next retry
excludes resources from earlier successful launches, allowing the capacity gate
to evaluate the remaining batch correctly.

@Oddly
Oddly merged commit 05d430c into main Aug 10, 2026
96 checks passed
@Oddly
Oddly deleted the chore/molecule-gate-more-patient branch August 10, 2026 11:36
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.

1 participant