Skip to content

Document helper-thread heartbeats with cancellation and teardown - #200

Merged
rmcdaniel merged 2 commits into
mainfrom
docs/199-threaded-heartbeats
Oct 23, 2026
Merged

rmcdaniel merged 2 commits into
mainfrom
docs/199-threaded-heartbeats

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Helper-thread heartbeat recipe

Refs #199.

Normally merged at 6bf63a1226fb1607b09ecced2ecce9b5c6afe0a6, exact qualified
tree 6b193f0247de26cf75243e9f9326884434ebdb74. All 18 final candidate checks
pass, including integration and target-branch qualification; Sonar has zero
OPEN/CONFIRMED. The remote head is deleted and verified absent.
Portal deployment 39878700601 passes. The public deployment-audit JSON matches
that merge, and the actual activity reference serves the new helper-thread
anchor and recipe. This is documentation deployment, not a PyPI 2.9.1 release.
Website #360 is separately merged at 526fd0e9 / 75468eb7; its all-eight-
language deployment and verification remain pending before #199 closes.

Current source: f0e4cd23c23209760e9147d9d7afcd6ae8dd96e3, whole tree
6b193f0247de26cf75243e9f9326884434ebdb74. The original 52cd candidate's
18 checks passed, but its actual Sonar issue API found a valid composite
assertion. Separate spec/loader assertions correct that finding. Current Sonar
passes with zero OPEN/CONFIRMED; the remaining normal CI checks are pending.

Add the complete, copyable example to the Python SDK reference. Capture the
activity context before starting the helper, send heartbeats on the original
worker loop, and stop/join the helper on both return and exception. Propagate
the original cancellation, authority-loss or transport exception after
cooperative work unwinds. Refuse use from an event-loop thread. Explain the
finite operation deadline, finite transport/retry budget and cooperative
cancellation requirements. A heartbeat helper cannot force a library call to
stop and does not prove business progress.

Seven focused tests pass against the normally installed PyPI 2.9.0 wheel
(1e7547e895485dc8f670bd1b9cc34184b135f249db8da98b16b250bfc6002f73)
in Python 3.13. They exercise actual context/loop behavior, unchanged original
task/attempt/worker identities, typed cancellation and authority loss,
transport failure, return/error teardown and event-loop refusal. Responses
are constructed in-process client fixtures, not a live Server cohort.
Ruff 0.14.0 and git diff --check pass. Normal CI, portal build and deployment
remain pending. No SDK runtime, dependency, protocol or version changes.

The main website's Python and heartbeat guides are updated separately in
Website #360
in all eight offered languages. The issue stays open until both documentation
surfaces are merged, deployed and checked.

@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel marked this pull request as ready for review October 23, 2026 00:31
@rmcdaniel
rmcdaniel merged commit 6bf63a1 into main Oct 23, 2026
18 checks passed
@rmcdaniel
rmcdaniel deleted the docs/199-threaded-heartbeats branch October 23, 2026 00:32
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