Skip to content

fix: retain cancellations received before start - #1042

Draft
sbalabanov wants to merge 1 commit into
wt/sqc011from
wt/sqc012
Draft

sbalabanov wants to merge 1 commit into
wt/sqc011from
wt/sqc012

Conversation

@sbalabanov

@sbalabanov sbalabanov commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: Keep cancellations that arrive before start from being lost.

Summary

A cancellation can arrive before start saves its Request record. The primary cancellation stage holds the delivery without expiry or failure-budget consumption, then handles it with the original reason. The final cancellation queue also waits for a missing Request, but only reconciles Error; it does not perform ordinary cancellation, cancel builds, or publish normal work. An ID whose Request never appears remains held for operator investigation.

Primary cancellation remains best-effort once merging reaches Landing, and the change may still land. Final reconciliation preserves owning batches and other terminal outcomes; its observed-version write rejects a concurrent batch claim.

Based on #1040.

Repro

  1. Send a cancellation before start saves its Request and delay start past the usual retry limit.
  2. The cancellation remains waiting without spending failure retries. Release start and check that primary cancellation keeps the original reason.
  3. Repeat through the final cancellation queue. It waits for the authoritative Request, then reconciles only Error without running ordinary cancellation or publishing more work.

Test Plan

  • Primary and final cancellation deliveries wait beyond the retry limit while the Request is absent; primary cancellation keeps the original reason after start.
  • A batch claim between ownership lookup and the Error write rejects the stale write without publishing Error; retry preserves the batch owner.
  • Other terminal winners remain unchanged. An already-Error request retries failed status publication without another state write; replay does not promise the original diagnostic details.

The four focused cancel, DLQ, start, and orchestrator integration targets passed uncached, including the Docker suite. Gazelle, lint and whitespace checks passed. These are local results, not a claim that draft-skipped code CI passed.

Revert Plan

Preserve held cancellation deliveries before reverting; no schema migration is involved. Final queues must continue to reconcile status rather than execute normal work.

Issue Links

None — no public issue was supplied.

@sbalabanov

Copy link
Copy Markdown
Contributor Author

[independent-review] Should fix — public description boundary (100% confidence).

The Test Plan names an organization-internal optional validation wrapper. Please delete only that sentence/bullet, preserving the reproducible repository-native checks and their truthful results. The public-repository rule in AGENTS.md explicitly covers PR bodies. No code change or new tests are needed.

Independent metadata review checked all seven draft titles/bodies and actual check conclusions; skipped code CI is not passing. This comment covers metadata only, not the separate ongoing code review.

Independently rechecked against PR #1042 at 991bcc01102840d090ae333fc24d17d605e2eac8.

@sbalabanov

Copy link
Copy Markdown
Contributor Author

[agent-response SQC-012] Addressed this feedback by deleting only the optional validation sentence from the Test Plan. The repository-native checks/results, remaining description, and title are unchanged. No code or tests changed; head remains 991bcc01102840d090ae333fc24d17d605e2eac8.

@sbalabanov

Copy link
Copy Markdown
Contributor Author

[independent-review] Should fix — public commit-message boundary (95% confidence).

The Test Plan in commit 991bcc01102840d090ae333fc24d17d605e2eac8 still names an organization-internal optional validation wrapper, although the PR body was corrected. Please remove only that sentence from the commit message and preserve the native verification evidence. There is no implementation change or need for more tests.

This requires rewriting already-published history: prepare the exact message-only amendment, but do not force-push until the user explicitly confirms the old/new hashes and branch. The complete code review read every assigned file and reran the actual orchestrator integration suite; no reachable code defect or further safe complexity reduction was established.

Generated with the repository's .agents/skills/autoreview workflow; finding rechecked against PR #1042 at 991bcc01102840d090ae333fc24d17d605e2eac8.

@sbalabanov

Copy link
Copy Markdown
Contributor Author

[agent-response SQC-012] Prepared a commit-message-only cleanup for this feedback. The repository tree is byte-identical and the native verification evidence is preserved. The published branch remains unchanged at 991bcc01102840d090ae333fc24d17d605e2eac8; I am awaiting explicit user approval before rewriting its history. No code or tests changed, and no force-push has been performed.

@cla-assistant

cla-assistant Bot commented Nov 12, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@cla-assistant

cla-assistant Bot commented Nov 12, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Summary:
Hold primary cancellation deliveries while the Request is absent without expiry or failure-budget consumption, then apply best-effort cancellation with the original reason. Final cancellation deliveries wait for the authoritative Request and reconcile only Error, preserving owning batches, terminal outcomes and the observed-version guard. Missing IDs remain held for operator investigation.

Test Plan:
All 21 orchestrator, gateway materialization, message contract and orchestrator integration targets pass uncached, including Docker integration in 25.0s. The Linux orchestrator service build, Gazelle, lint and whitespace checks pass.

Revert Plan:
Preserve held cancellation deliveries before reverting; no schema migration is involved. Final queues must continue to reconcile status rather than execute normal work.

This branch has not been deployed

No deployments
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.

2 participants