Fix: Propagate WorkflowOptions.priority through signalWithStart#2966
Open
vathsalaR wants to merge 2 commits into
Open
Fix: Propagate WorkflowOptions.priority through signalWithStart#2966vathsalaR wants to merge 2 commits into
vathsalaR wants to merge 2 commits into
Conversation
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.
What was changed
Added Priority propagation to
WorkflowClientRequestFactory.newSignalWithStartWorkflowExecutionRequest— one if(startParameters.hasPriority())block, mirroring the existing pattern already used for memo, searchAttributes, header, userMetadata, and versioningOverride in the same method.Also added a regression test in
PriorityInfoTest.java (testPriorityWithSignalWithStart)exercisingWorkflowStub.signalWithStart(...)with Priority set on WorkflowOptions, asserting the workflow observes the priority viaWorkflow.getInfo().getPriority().Why?
signalWithStart never propagated WorkflowOptions.priority onto the wire, despite
SignalWithStartWorkflowExecutionRequest (request_response.proto, field 26)already supporting it — only the plain start() path (newStartWorkflowExecutionRequest) set it.There's a comment directly above that method — // If you add anything new here, keep newSignalWithStartWorkflowExecutionRequest in sync — suggesting this was simply missed when Priority was added. Confirmed via SDK source across every version from 1.31.0 (when Priority was introduced) through the latest release — never fixed. Verified live against a real Temporal cluster: a signalWithStart dispatch with priorityKey set produced a WorkflowExecutionStarted event with no priority field at all.
This silently breaks any caller relying on signalWithStart for priority — including workflows that need "signal if already running, else start" semantics and can't safely switch to plain start() without losing that behavior.
Checklist