Fix interceptor contract inconsistency for start_update_with_start_workflow#1588
Open
brucearctor wants to merge 1 commit into
Open
Fix interceptor contract inconsistency for start_update_with_start_workflow#1588brucearctor wants to merge 1 commit into
brucearctor wants to merge 1 commit into
Conversation
572c339 to
91e26f1
Compare
…rkflow Add top-level rpc_metadata and rpc_timeout fields to StartWorkflowUpdateWithStartInput, making it consistent with every other OutboundInterceptor input dataclass. Previously this composite input lacked these fields, forcing interceptors to special-case it. Also fix the _ClientImpl to actually pass rpc_metadata and rpc_timeout to the execute_multi_operation gRPC call, which were previously silently dropped. Add a test verifying that rpc_metadata set by an interceptor on StartWorkflowUpdateWithStartInput is forwarded to the gRPC call. Fixes temporalio#1582
91e26f1 to
a66bda4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1582.
StartWorkflowUpdateWithStartInputwas the onlyOutboundInterceptorinput dataclass missing top-levelrpc_metadataandrpc_timeoutfields, breaking interceptors that generically set metadata on every outbound call.Additionally,
_ClientImpl._start_workflow_update_with_start()intemporalio/client/_impl.pycalledexecute_multi_operation()without passingmetadata=ortimeout=, silently dropping any RPC metadata.Changes
temporalio/client/_interceptor.pyrpc_metadata: Mapping[str, str | bytes]andrpc_timeout: timedelta | Nonefields toStartWorkflowUpdateWithStartInputtemporalio/client/_client.pyClient._start_update_with_start()temporalio/client/_impl.pyrpc_metadataandrpc_timeoutthrough_start_workflow_update_with_start()to theexecute_multi_operation()gRPC callretry=Trueto theexecute_multi_operation()call to match every other gRPC call site in this file (this was a pre-existing omission, not part of [Bug] Interceptor contract inconsistency for OutboundInterceptor.start_update_with_start_workflow #1582)tests/worker/test_update_with_start.pytest_update_with_start_rpc_metadata_and_timeout_forwardedwhich verifies:rpc_metadatavia the new top-level fieldrpc_metadatais preservedrpc_timeoutis forwarded to the gRPC callBackward Compatibility
StartWorkflowUpdateWithStartInputis only constructed internally (inClient._start_update_with_start), not by external callersrpc_metadataon this method — they manipulateheaders. No changes needed to themrpc_metadatafields for introspectionTesting
tests/worker/test_update_with_start.pypasspyright: 0 errors, 0 warningsruff+pydocstyle: clean