Skip to content

Rust #325: deliver a parent's cooperative cancellation to a retried child - #876

Merged
rmcdaniel merged 1 commit into
mainfrom
rust-325-retried-child-cancellation
Oct 30, 2026
Merged

rmcdaniel merged 1 commit into
mainfrom
rust-325-retried-child-cancellation

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Closes #873. Part of #325. Follows #869 and #874.

What changes

After #869, a retried child call has a link per attempt, and the call names the latest attempt's run. Native's cooperative cancellation expected one link per call. So once a child had been retried, a parent's cancellation request was refused (422 cooperative_cancellation_propagation_not_available). Security found this in #869's review.

Published 2.11.7 admits the request, delivers it at the child boundary, and completes the parent as cancelled:

  • under abandon, the retry keeps running;
  • under try_cancel, the parent records ChildCancellationRequested naming the retry run, and that run records CooperativeCancellationRequested.

PHP's retry ChildRunStarted carries no cancellation_policy.

Native changes:

  • child_link_policies accepts a retried call's links: the first under the call's id, each retry under its own, and earlier attempts.
  • The delivery boundary reads every link of the call and picks the one for the call's current run. It accepts the call's scheduled event and one started event per attempt; a retry's may omit the cancellation policy.

Fixture retried-child-cancellation

Raw worker HTTP on protocol 1.20, with a cooperative parent worker and a separate child worker. There is one case per policy (abandon, try_cancel). It records:

  • the answers;
  • the parent's child and cancellation events;
  • the child's runs and the retry run's events.

Local checks

  • retried-child-cancellation. It passes on a fresh published 2.11.7 harness and on native built from this branch, and compare accepts the pair.
  • Neighbors. On that native image, these pass: child-retries, parent-close-cancellation, cooperative-before-claim-cleanup, cooperative-pending-timer-cleanup and direct-child-cancel-pending-timer.
  • Rust suites. Library 363 and integration 641, all passing, including every cooperative test. The new test is a_parents_cooperative_cancellation_reaches_a_retried_child.
  • Contract unit test. It passes 6/6.

This PR also corrects two stale lines in the port doc: activity delivery is already served, and the 2.11.5 reference move is done.

Checkpoint.

🤖 Generated with Claude Code

@rmcdaniel
rmcdaniel added this pull request to the merge queue Oct 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 30, 2026
A retried child call has a link per attempt, and its call names the
latest attempt's run. Native's cooperative cancellation expected one link
per call, so it refused a parent's request once a child had been retried.
child_link_policies now accepts a retried call's links, and the delivery
boundary follows the call to its current run and link, accepting a
retry's ChildRunStarted without the call's cancellation policy, as
published PHP records it. Under try_cancel the retry run, not the failed
first run, is asked to cancel.

The retried-child-cancellation fixture records both policies against
published 2.11.7. Closes #873.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel
rmcdaniel force-pushed the rust-325-retried-child-cancellation branch from d2b9c32 to e2b9f02 Compare October 30, 2026 10:23
@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 73bc484 Oct 30, 2026
58 checks passed
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.

Rust #325: cooperative cancellation delivered to a retried child

1 participant