File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
service/history/api/queryworkflow Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,16 @@ func Invoke(
9696 }, nil
9797 }
9898 }
99+ // If workflow is paused, return query rejected with PAUSED status.
100+ if mutableStateStatus == enumspb .WORKFLOW_EXECUTION_STATUS_PAUSED {
101+ return & historyservice.QueryWorkflowResponse {
102+ Response : & workflowservice.QueryWorkflowResponse {
103+ QueryRejected : & querypb.QueryRejected {
104+ Status : enumspb .WORKFLOW_EXECUTION_STATUS_PAUSED ,
105+ },
106+ },
107+ }, nil
108+ }
99109
100110 mutableState := workflowLease .GetMutableState ()
101111 if ! mutableState .IsWorkflowExecutionRunning () && ! mutableState .HasCompletedAnyWorkflowTask () {
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ func (s *PauseWorkflowExecutionSuite) TestQueryWorkflowWhenPaused() {
165165 }
166166 }, 5 * time .Second , 200 * time .Millisecond )
167167
168- // Issue a query with reject condition so that paused workflows return QueryRejected with PAUSED status.
168+ // Issue a query to the paused workflow. It should return QueryRejected with WORKFLOW_EXECUTION_STATUS_PAUSED status.
169169 queryReq := & workflowservice.QueryWorkflowRequest {
170170 Namespace : s .Namespace ().String (),
171171 Execution : & commonpb.WorkflowExecution {
@@ -175,7 +175,6 @@ func (s *PauseWorkflowExecutionSuite) TestQueryWorkflowWhenPaused() {
175175 Query : & querypb.WorkflowQuery {
176176 QueryType : "__stack_trace" ,
177177 },
178- QueryRejectCondition : enumspb .QUERY_REJECT_CONDITION_NOT_OPEN ,
179178 }
180179 queryResp , err := s .FrontendClient ().QueryWorkflow (ctx , queryReq )
181180 s .NoError (err )
You can’t perform that action at this time.
0 commit comments