Skip to content

Include owned child stacks in claim cancellation failures - #1025

Open
zlareb1 wants to merge 4 commits into
mainfrom
fix/claim-cancel-evidence-20261120
Open

zlareb1 wants to merge 4 commits into
mainfrom
fix/claim-cancel-evidence-20261120

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

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

Why

A claim-release cancellation failure can leave only the event-loop selector in its thread stack. That stack cannot distinguish a suspended prompt from retirement cleanup. The failed exit check also records bounded coroutine frames, cancellation counts, signal state and lifecycle counters from its owned child.

The cause of the cancellation failure remains unknown. This change supplies evidence; it does not fix command cancellation.

Scope and risk

Only the native-command test fixture changes. The trace retains its all-thread stack and adds at most eight tasks with eight frames each. Frame names and file names are capped at 64 characters, and an encoded packet above 32,700 bytes is replaced by a fixed truncation marker. Arguments, locals, task names, input, environment values and exception text are excluded. Observer errors emit a fixed failure marker when the trace remains writable.

The existing cancellation test adds diagnostics only after its five-second exit deadline has failed, then still fails the test. All 53 original assertions and the ten-second prompt deadline remain unchanged. The new coroutine collector and controls retain the prior thread-diagnostic version of all five test bodies, covering 14 cases. A separate control begins with an already-cancelled command suspended before cleanup; it tests the observer without adding another prompt-signal timing race.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: reverting removes test diagnostics and controls.

Tests

  • Controlled observer regression: the thread-only collector fails to expose the suspended coroutine; enabling the async-state collector passes.
  • .venv/bin/python -m pytest tests/unit/test_native_command_retirement.py -q -p no:randomly: 18 passed.
  • Scoped Ruff checks, formatting, prose and diff checks pass.
  • AST comparison retains all original assertions and the prompt-wait helper. The prior thread-diagnostic version of all five test bodies is unchanged by the coroutine collector.
  • Full hosted CI and a fresh independent review are required on the final public head.

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

  • AI-generated (an agent wrote most of the diff): Codex; checked the signal path, output bounds, original test bodies and failure preservation.

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

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • Generated files are unaffected.
  • No migration changes.
  • No shipped plugin changes.
  • No frontend changes.
  • No operator steps or wire changes.
  • Repository text has no deployment details.
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

@zlareb1
zlareb1 force-pushed the fix/claim-cancel-evidence-20261120 branch 2 times, most recently from c74ea94 to 00c9e87 Compare November 20, 2026 22:25
@vercel

vercel Bot commented Nov 20, 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 12:33am UTC

Request Review

@zlareb1
zlareb1 force-pushed the fix/claim-cancel-evidence-20261120 branch from 00c9e87 to 41806d6 Compare November 20, 2026 23:07
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 force-pushed the fix/claim-cancel-evidence-20261120 branch from 41806d6 to 85f66ef Compare November 21, 2026 00:08
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

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.

1 participant