Skip to content

Darkbloom watchdog: copy darkbloom-sandbox's template at d6d257c2 (reads any listing size, rescues partial strands) [dev] - #1861

Merged
davidtai merged 2 commits into
devfrom
ci/watchdog-template-dev
Nov 6, 2026
Merged

davidtai merged 2 commits into
devfrom
ci/watchdog-template-dev

Conversation

@davidtai

@davidtai davidtai commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Into dev: keeps dev the same as master. The master PR carries the same change; the scheduled watchdog runs from master only.

Summary

.github/workflows/darkbloom-watchdog.yml is now darkbloom-sandbox's watchdog template at d6d257c2 (public/darkbloom-actions/.github/workflows/watchdog.yml, darkbloom-sandbox #357/#359), copied byte for byte. The old copy (template at 31236c54) failed whenever this repository was busy.

Cause. The old template put the day's run and job listings on jq's command line (jq --argjson all "$all", --argjson more "$more"). Linux allows at most 128 KiB for one argument. A busy day of d-inference runs is larger, so the watchdog exited 126 with /usr/bin/jq: Argument list too long before it checked any run.

Evidence. Watchdog runs 42259175576 and 42261403378 on 2026-11-06 both failed with that error.

What the new template changes (darkbloom-sandbox d6d257c2):

  • Listing pages go to files and are merged with jq -cs 'add // []'. The rest goes through stdin. The only remaining --argjson values are scalars (attempt numbers, epoch seconds and a boolean).
  • A stranded job's wait is timed from its own created_at. It is no longer timed from the later of its creation and the attempt's last finished job.
  • Only a Darkbloom job of the run that got a runner within the wait holds the rescue back. Jobs that ran, or still run, no longer do. So a run with one shard stranded while other shards ran is now rescued: it is cancelled and its route is re-run. This is a deliberate change in darkbloom-sandbox.
  • The header comment now says that a job waiting at a payer's concurrency or resource limit looks stranded to the watchdog. GitHub shows no sign of that wait, so set DARKBLOOM_WATCHDOG_MINUTES above such waits.

Repository variables: no new ones. It reads the same four variables as before: DARKBLOOM_WATCHDOG, DARKBLOOM_WATCHDOG_MINUTES, DARKBLOOM_ROUTE_JOB and DARKBLOOM_APP_SLUG.

Self-test (scripts/test-darkbloom-route.py). The WATCHDOG comment now names d6d257c2. test_watchdog_rescues_only_this_repositorys_routed_runs still proves every property it proved before: schedule and dispatch only, permissions: {} at the top, actions/checks: write on this repository only, no uses:/secrets/checkout, the Darkbloom-label selector, unrouted workflows carry no Darkbloom label, and the Select Runners suffix match. Each of those strings is still in the new template. The test never pinned the old stranding rule, so that change needs no test change. It now also asserts that no listing ($all, $more, $runs, $jobs, $cancelled) is passed to jq as --arg/--argjson. This pattern matches 3 lines in the old template and 0 in the new one.

Docs. docs/developer/build.md gives the new source commit and describes the new stranding rule and the limit-wait caveat. The docs-impact rules do not map this workflow; the doc is updated because it names the commit and the rule.

Diagrams

Before:

flowchart LR
  L[list runs and jobs, page by page] --> A["jq --argjson all \"$all\" (grows each page)"]
  A -->|listing over 128 KiB| E[exit 126: Argument list too long]
  A -->|small listing| S{"stranded? no Darkbloom job of the run started or finished in the wait"}
Loading

After:

flowchart LR
  L[list runs and jobs, page by page] --> F["pages appended to files; jq -cs 'add // []'"]
  F --> S{"stranded? a queued Darkbloom job waited since its own creation, and no Darkbloom job of the run got a runner in the wait"}
  S -->|yes| R[mark, cancel, re-run route and dependents once]
Loading

Test plan

  • cmp of the copy with git show d6d257c2:public/darkbloom-actions/.github/workflows/watchdog.yml in darkbloom-sandbox: identical.
  • The new assertion's pattern, run with grep -E, matches the old template 3 times and the new one 0 times.
  • CI runs python3 scripts/test-darkbloom-route.py (release-integrity) and the docs checks. Nothing was run on the laptop.
  • The watchdog itself runs only from the default branch. Its next scheduled run after the master PR merges is the live check.

Components touched

  • CI / provider release
  • docs

Protocol / interface changes

  • No protocol/interface changes

Documentation impact

  • Canonical documentation updated (docs/developer/build.md)

Refactor pass

Not run in this PR. The coordinating session owns the Required Refactor Pass.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…ads any listing size, rescues partial strands)

The copy of darkbloom-sandbox's watchdog template at 31236c54 passed the
day's run and job listings to jq as --argjson arguments. On a busy day they
are larger than the 128 KiB Linux allows for one argument, and the watchdog
exited 126 with "/usr/bin/jq: Argument list too long" before it checked a
run (runs 42259175576 and 42261403378, 2026-11-06). darkbloom-sandbox
d6d257c2 (#357, #359) passes listings through files and stdin, times a
stranded job from its own creation and rescues a run with only some jobs
stranded. The file is copied byte for byte.

The route self-test names the new source commit and asserts that no
listing goes to jq as an argument. build.md describes the new stranding
rule and its limit-wait caveat. The repository variables are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Error Error Nov 6, 2026 6:36pm UTC
d-inference-console-ui-dev Error Error Nov 6, 2026 6:36pm UTC
d-inference-landing Ready Ready Preview Nov 6, 2026 6:36pm UTC
darkbloom-status Ready Ready Preview Nov 6, 2026 6:36pm UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 6, 2026 6:36pm UTC

Request Review

The paragraph said other Darkbloom jobs that ran, or still run, do not
hold the rescue back. A job that got its runner within the wait does
hold it back, also when it still runs; only a job that got its runner
before the wait does not. The paragraph now says this, in shorter
sentences. The rule, the partial-strand rescue and the payer-limit
caveat are those of the template at d6d257c2, which stays unchanged.

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

This branch had an error being deployed

2 failed and 3 active deployments
Preview – eigen-homepages-darkbloom — 62da9ad4 Deployed Nov 6, 2026 by vercel[bot]
Preview – d-inference-landing — 62da9ad4 Deployed Nov 6, 2026 by vercel[bot]
Preview – darkbloom-status — 62da9ad4 Deployed Nov 6, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 62da9ad4 Deployed Nov 6, 2026 by vercel[bot]
Preview – d-inference — 62da9ad4 Deployed Nov 6, 2026 by vercel[bot]
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