Skip to content

fix(client): include request_id on TerminateActivityExecutionRequest (#2008) - #2022

Closed
musi22 wants to merge 1 commit into
temporalio:mainfrom
musi22:fix/activity-terminate-request-id
Closed

musi22 wants to merge 1 commit into
temporalio:mainfrom
musi22:fix/activity-terminate-request-id

Conversation

@musi22

@musi22 musi22 commented Oct 25, 2026

Copy link
Copy Markdown

What does this PR do?

Populate
equest_id=str(uuid.uuid4())\ when constructing \TerminateActivityExecutionRequest\ in _ClientImpl.terminate_activity().

Why?

\ erminate_activity\ calls \ erminate_activity_execution\ with
etry=True. When
equest_id\ was omitted, the server generated a new request ID on every retry attempt, meaning retried RPCs could not be deduplicated if the initial response was dropped (e.g. transient network glitch). The retried request then failed with \NotFound: no running activity execution: it closed with status TERMINATED.

Setting
equest_id\ makes retries idempotent, matching sibling calls (\cancel_activity, \pause_activity, \unpause_activity, \start_activity) and the Temporal Go SDK.

Testing

Added unit test in \ ests/test_activity_operator_commands_requests.py\ verifying that \TerminateActivityExecutionRequest\ sent over the wire contains a valid non-empty UUID
equest_id.

Fixes #2008

@musi22
musi22 requested a review from a team as a code owner October 25, 2026 17:43
@CLAassistant

CLAassistant commented Oct 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tconley1428

Copy link
Copy Markdown
Contributor

There's already an open PR for this issue:
#2009

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.

[Bug] Retried ActivityHandle.terminate() can fail after the activity is already terminated

3 participants