Skip to content

A deploy waits a grace for its build record before it is a mismatch - #67

Merged
fgurbanov merged 1 commit into
mainfrom
runtime/build-grace
Sep 27, 2026
Merged

fgurbanov merged 1 commit into
mainfrom
runtime/build-grace

Conversation

@fgurbanov

Copy link
Copy Markdown
Contributor

A deploy now waits up to 300 s for its build record before counting as a digest mismatch; a false mismatch would raise a SEV item.

The hazard. Pipelines put maestro.build before maestro.deploy, but runtime-service's intake is a standard SQS queue, which doesn't keep order.

How it showed. runtime-service's first apply on the first tenant hit this: the intake's first batch failed because the workspace wasn't applied yet, so four events were retried. They happened to come back in order.

The fix.

  • A deploy of a digest the ledger has never seen, younger than BUILD_GRACE_SECONDS (default 300), isn't recorded. The Lambda reports it as a batch-item failure and SQS retries it.
  • The queue's visibility timeout (360 s) outlasts the grace. The retry then records it: built if its record arrived, a mismatch if not. T2 still holds, 5 minutes later.
  • Over HTTP it answers 425 Too Early. A grace of 0 means no wait (the tests use 0 unless they ask).

Checks. runtime: 30 tests. New grace.test.ts:

  • a young deploy gets 425 and records nothing;
  • its build arrives and the retry records it, running with no signal;
  • an old unseen deploy is a mismatch.

🤖 Generated with Claude Code

The pipeline puts `maestro.build` before `maestro.deploy`, but runtime-service's intake queue is a
standard queue and a retry can bring the deploy first: that would record a false DigestMismatchDetected
and raise a SEV item. A deploy of a digest the ledger has never seen, younger than
BUILD_GRACE_SECONDS (300), is now retried rather than recorded — the queue's visibility timeout (360s)
outlasts the grace, so the retry records it, built or a mismatch. Over HTTP it answers 425.

Seen on the first tenant's first apply: the intake's first batch failed (its workspace was not yet
applied), and the retries could have come back in any order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fgurbanov
fgurbanov merged commit 80dacf8 into main Sep 27, 2026
5 checks passed
@fgurbanov
fgurbanov deleted the runtime/build-grace branch September 27, 2026 12:28
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