Skip to content

Claim cancellation traces include the pending waiter's state - #1100

Merged
zlareb1 merged 1 commit into
mainfrom
test/claim-cancellation-waiter-state
Nov 21, 2026
Merged

zlareb1 merged 1 commit into
mainfrom
test/claim-cancellation-waiter-state

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 21, 2026

Copy link
Copy Markdown
Member

Related: #1072
Related: #1025

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Not required.

Why

A failed claim cancellation can leave a task with one cancellation request while it still waits for input. The failure trace needs the waiter's state to distinguish a consumed request from a cancelled waiter awaiting its task's next step.

Scope and risk

Only the claim cancellation test's failure observer changes. It records fixed task and waiter booleans, plus the pending cancellation flag when the runtime exposes it. Task names, arguments, local values, input and exception content stay out of the packet. The existing task, frame and byte limits remain.

This adds diagnostic evidence; it does not establish or repair the cancellation failure's cause. The command, signal tests, stdin behavior, lifecycle assertions and exit deadlines are unchanged.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: reverting leaves no stored data or generated files.

Tests

Two isolated controls fail with missing observer fields before the change and pass after it. They distinguish a cancelled waiter before task resumption from a consumed cancellation followed by a fresh waiter.

The five selected observer and privacy cases pass. Scoped Ruff, format, prose and whitespace checks pass. An AST comparison verifies that every existing test and helper except the observer is unchanged, that all original assertions remain, and that the two new controls match their failing versions.

Full hosted CI and a fresh independent review are required after publication. The natural signal race and the claim subprocess tests were not repeated locally.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: Codex wrote the observer fields and isolated controls. The source diff, regression failures, focused results and preservation proof were checked.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Full format, lint, type and unit gates pass in hosted CI before merge.
  • No generated files, migrations, plugin files, frontend code, runtime configuration or wire behavior change.
  • Public text passes the prose check.
  • The commit is signed off.

Cancellation request counts omit whether their waiter was cancelled or replaced. Fixed booleans distinguish those states without recording private task content.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 21, 2026 3:05am UTC

Request Review

@zlareb1
zlareb1 merged commit e1bae8a into main Nov 21, 2026
49 checks passed
zlareb1 added a commit that referenced this pull request Nov 21, 2026
Related: #1045
Related: #1100

### Changelog category

- CI Fix or Improvement

### Why

The person-decision integration fixture wraps a shared client and records unrelated background reads. A schema watcher uses an independent context and can omit a default read timeout. Capture only the decision query tag observed at entry, while retaining decision reads with no timeout so the finite-budget assertion can reject them.

### Scope and risk

Both query methods retain the original finite-budget assertion. Ten controls cover concurrent schema reads, unbounded decision reads and the real decision reader with a fake driver. The earlier hosted log does not identify its offending SQL; these controls reproduce the capture defect without establishing a unique cause for that run.

The two repository renewal cases use a private function loop whose watchdog clock advances during selector waits. Repository expiry stays separate. Original bodies, the 5 ms expiry, 100 ms watchdog, cancellation cleanup and base-proof assertions remain.

The claim-cancellation test module composes the reviewed diagnostic observer from #1100. On failure it records fixed task and waiter booleans within the existing privacy and byte limits. Two event-driven controls distinguish cancellation awaiting task resumption from cancellation consumed before another pending wait. Original claim assertions, input handling, signal delivery and deadlines remain unchanged. The natural cancellation failure's cause remains unknown; this adds evidence and does not repair cancellation.

### Compatibility, rollout and rollback

Only test fixtures and their controls change. Production code, wire fields, settings, schema and operator steps remain unchanged. Reverting restores the previous test fixtures. No stored data changes.

### Tests

On this current-main head, 36 directly related SCIM query, replicated-erasure and repository-expiry cases pass. Five pure claim observer and privacy controls also pass; no real claim subprocess or signal-race test ran locally. Scoped Ruff, formatting, public-body prose and committed-range whitespace checks pass.

Earlier fail-first capture and observer receipts remain prior-source evidence. They are not new runs on this head. All three prior concern files retain their exact reviewed bytes and modes; the claim module exactly matches #1100. The complete tree is current main plus these four files. Full hosted CI, including the actual-client integration and claim cancellation cases, and a fresh independent whole review remain required for this exact head.

### AI assistance in the code

- AI-generated: Codex prepared the fixture corrections and diagnostic controls.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [ ] Full required hosted checks pass on this head.
- [x] Production budgets, assertions and diagnostic limits remain unchanged.
- [x] No generated files or operator steps are required.
- [x] Commits are signed off.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
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