diff --git a/.gen/go/shared/idl.go b/.gen/go/shared/idl.go index 4c3ec8da04e..bbf50b7f85d 100644 --- a/.gen/go/shared/idl.go +++ b/.gen/go/shared/idl.go @@ -30,8 +30,8 @@ var ThriftModule = &thriftreflect.ThriftModule{ Name: "shared", Package: "github.com/uber/cadence/.gen/go/shared", FilePath: "shared.thrift", - SHA1: "0da8f44f08f449b9155322473141320082b109e2", + SHA1: "061e5d77656c005af99aa473b47809cc1c0247ab", Raw: rawIDL, } -const rawIDL = "// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace java com.uber.cadence\n\nexception BadRequestError {\n 1: required string message\n}\n\nexception InternalServiceError {\n 1: required string message\n}\n\nexception DomainAlreadyExistsError {\n 1: required string message\n}\n\nexception WorkflowExecutionAlreadyStartedError {\n 10: optional string message\n 20: optional string startRequestId\n 30: optional string runId\n}\n\nexception EntityNotExistsError {\n 1: required string message\n}\n\nexception ServiceBusyError {\n 1: required string message\n}\n\nexception CancellationAlreadyRequestedError {\n 1: required string message\n}\n\nexception QueryFailedError {\n 1: required string message\n}\n\nenum DomainStatus {\n REGISTERED,\n DEPRECATED,\n DELETED,\n}\n\nenum TimeoutType {\n START_TO_CLOSE,\n SCHEDULE_TO_START,\n SCHEDULE_TO_CLOSE,\n HEARTBEAT,\n}\n\nenum DecisionType {\n ScheduleActivityTask,\n RequestCancelActivityTask,\n StartTimer,\n CompleteWorkflowExecution,\n FailWorkflowExecution,\n CancelTimer,\n CancelWorkflowExecution,\n RequestCancelExternalWorkflowExecution,\n RecordMarker,\n ContinueAsNewWorkflowExecution,\n StartChildWorkflowExecution,\n}\n\nenum EventType {\n WorkflowExecutionStarted,\n WorkflowExecutionCompleted,\n WorkflowExecutionFailed,\n WorkflowExecutionTimedOut,\n DecisionTaskScheduled,\n DecisionTaskStarted,\n DecisionTaskCompleted,\n DecisionTaskTimedOut\n DecisionTaskFailed,\n ActivityTaskScheduled,\n ActivityTaskStarted,\n ActivityTaskCompleted,\n ActivityTaskFailed,\n ActivityTaskTimedOut,\n ActivityTaskCancelRequested,\n RequestCancelActivityTaskFailed,\n ActivityTaskCanceled,\n TimerStarted,\n TimerFired,\n CancelTimerFailed,\n TimerCanceled,\n WorkflowExecutionCancelRequested,\n WorkflowExecutionCanceled,\n RequestCancelExternalWorkflowExecutionInitiated,\n RequestCancelExternalWorkflowExecutionFailed,\n ExternalWorkflowExecutionCancelRequested,\n MarkerRecorded,\n WorkflowExecutionSignaled,\n WorkflowExecutionTerminated,\n WorkflowExecutionContinuedAsNew,\n StartChildWorkflowExecutionInitiated,\n StartChildWorkflowExecutionFailed,\n ChildWorkflowExecutionStarted,\n ChildWorkflowExecutionCompleted,\n ChildWorkflowExecutionFailed,\n ChildWorkflowExecutionCanceled,\n ChildWorkflowExecutionTimedOut,\n ChildWorkflowExecutionTerminated,\n}\n\nenum DecisionTaskFailedCause {\n UNHANDLED_DECISION,\n BAD_SCHEDULE_ACTIVITY_ATTRIBUTES,\n BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES,\n BAD_START_TIMER_ATTRIBUTES,\n BAD_CANCEL_TIMER_ATTRIBUTES,\n BAD_RECORD_MARKER_ATTRIBUTES,\n BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CONTINUE_AS_NEW_ATTRIBUTES,\n START_TIMER_DUPLICATE_ID,\n RESET_STICKY_TASKLIST,\n WORKFLOW_WORKER_UNHANDLED_FAILURE\n}\n\nenum CancelExternalWorkflowExecutionFailedCause {\n UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n}\n\nenum ChildWorkflowExecutionFailedCause {\n WORKFLOW_ALREADY_RUNNING,\n}\n\nenum WorkflowExecutionCloseStatus {\n COMPLETED,\n FAILED,\n CANCELED,\n TERMINATED,\n CONTINUED_AS_NEW,\n TIMED_OUT,\n}\n\nenum ChildPolicy {\n TERMINATE,\n REQUEST_CANCEL,\n ABANDON,\n}\n\nenum QueryTaskCompletedType {\n COMPLETED,\n FAILED,\n}\n\nstruct WorkflowType {\n 10: optional string name\n}\n\nstruct ActivityType {\n 10: optional string name\n}\n\nstruct TaskList {\n 10: optional string name\n}\n\nstruct TaskListMetadata {\n 10: optional double maxTasksPerSecond\n}\n\nstruct WorkflowExecution {\n 10: optional string workflowId\n 20: optional string runId\n}\n\nstruct WorkflowExecutionInfo {\n 10: optional WorkflowExecution execution\n 20: optional WorkflowType type\n 30: optional i64 (js.type = \"Long\") startTime\n 40: optional i64 (js.type = \"Long\") closeTime\n 50: optional WorkflowExecutionCloseStatus closeStatus\n 60: optional i64 (js.type = \"Long\") historyLength\n}\n\nstruct WorkflowExecutionConfiguration {\n 10: optional TaskList taskList\n 20: optional i32 executionStartToCloseTimeoutSeconds\n 30: optional i32 taskStartToCloseTimeoutSeconds\n 40: optional ChildPolicy childPolicy\n 50: optional TaskList stickyTaskList\n 60: optional i32 stickyScheduleToStartTimeoutSeconds\n}\n\nstruct TransientDecisionInfo {\n 10: optional HistoryEvent scheduledEvent\n 20: optional HistoryEvent startedEvent\n}\n\nstruct ScheduleActivityTaskDecisionAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n}\n\nstruct RequestCancelActivityTaskDecisionAttributes {\n 10: optional string activityId\n}\n\nstruct StartTimerDecisionAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n}\n\nstruct CompleteWorkflowExecutionDecisionAttributes {\n 10: optional binary result\n}\n\nstruct FailWorkflowExecutionDecisionAttributes {\n 10: optional string reason\n 20: optional binary details\n}\n\nstruct CancelTimerDecisionAttributes {\n 10: optional string timerId\n}\n\nstruct CancelWorkflowExecutionDecisionAttributes {\n 10: optional binary details\n}\n\nstruct RequestCancelExternalWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional string runId\n 40: optional binary control\n}\n\nstruct RecordMarkerDecisionAttributes {\n 10: optional string markerName\n 20: optional binary details\n}\n\nstruct ContinueAsNewWorkflowExecutionDecisionAttributes {\n 10: optional WorkflowType workflowType\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n}\n\nstruct StartChildWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional ChildPolicy childPolicy\n 90: optional binary control\n}\n\nstruct Decision {\n 10: optional DecisionType decisionType\n 20: optional ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes\n 25: optional StartTimerDecisionAttributes startTimerDecisionAttributes\n 30: optional CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes\n 35: optional FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes\n 40: optional RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes\n 50: optional CancelTimerDecisionAttributes cancelTimerDecisionAttributes\n 60: optional CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes\n 70: optional RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes\n 80: optional RecordMarkerDecisionAttributes recordMarkerDecisionAttributes\n 90: optional ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes\n 100: optional StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes\n}\n\nstruct WorkflowExecutionStartedEventAttributes {\n 10: optional WorkflowType workflowType\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n 60: optional string identity\n}\n\nstruct WorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n}\n\nstruct WorkflowExecutionContinuedAsNewEventAttributes {\n 10: optional string newExecutionRunId\n 20: optional WorkflowType workflowType\n 30: optional TaskList taskList\n 40: optional binary input\n 50: optional i32 executionStartToCloseTimeoutSeconds\n 60: optional i32 taskStartToCloseTimeoutSeconds\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct DecisionTaskScheduledEventAttributes {\n 10: optional TaskList taskList\n 20: optional i32 startToCloseTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") attempt\n}\n\nstruct DecisionTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n}\n\nstruct DecisionTaskCompletedEventAttributes {\n 10: optional binary executionContext\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n}\n\nstruct DecisionTaskTimedOutEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n}\n\nstruct DecisionTaskFailedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional DecisionTaskFailedCause cause\n 35: optional binary details\n 40: optional string identity\n}\n\nstruct ActivityTaskScheduledEventAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n}\n\nstruct ActivityTaskCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n}\n\nstruct ActivityTaskFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct ActivityTaskTimedOutEventAttributes {\n 05: optional binary details\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n}\n\nstruct ActivityTaskCancelRequestedEventAttributes {\n 10: optional string activityId\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct RequestCancelActivityTaskFailedEventAttributes{\n 10: optional string activityId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskCanceledEventAttributes {\n 10: optional binary details\n 20: optional i64 (js.type = \"Long\") latestCancelRequestedEventId\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct TimerStartedEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct TimerFiredEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct TimerCanceledEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct CancelTimerFailedEventAttributes {\n 10: optional string timerId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct WorkflowExecutionCancelRequestedEventAttributes {\n 10: optional string cause\n 20: optional i64 (js.type = \"Long\") externalInitiatedEventId\n 30: optional WorkflowExecution externalWorkflowExecution\n 40: optional string identity\n}\n\nstruct WorkflowExecutionCanceledEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional binary details\n}\n\nstruct MarkerRecordedEventAttributes {\n 10: optional string markerName\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionSignaledEventAttributes {\n 10: optional string signalName\n 20: optional binary input\n 30: optional string identity\n}\n\nstruct WorkflowExecutionTerminatedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RequestCancelExternalWorkflowExecutionInitiatedEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional binary control\n}\n\nstruct RequestCancelExternalWorkflowExecutionFailedEventAttributes {\n 10: optional CancelExternalWorkflowExecutionFailedCause cause\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionCancelRequestedEventAttributes {\n 10: optional i64 (js.type = \"Long\") initiatedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n}\n\nstruct StartChildWorkflowExecutionInitiatedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional ChildPolicy childPolicy\n 90: optional binary control\n 100: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct StartChildWorkflowExecutionFailedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional ChildWorkflowExecutionFailedCause cause\n 50: optional binary control\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ChildWorkflowExecutionStartedEventAttributes {\n 10: optional string domain\n 20: optional i64 (js.type = \"Long\") initiatedEventId\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n}\n\nstruct ChildWorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional WorkflowType workflowType\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionCanceledEventAttributes {\n 10: optional binary details\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTerminatedEventAttributes {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") initiatedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct HistoryEvent {\n 10: optional i64 (js.type = \"Long\") eventId\n 20: optional i64 (js.type = \"Long\") timestamp\n 30: optional EventType eventType\n 40: optional WorkflowExecutionStartedEventAttributes workflowExecutionStartedEventAttributes\n 50: optional WorkflowExecutionCompletedEventAttributes workflowExecutionCompletedEventAttributes\n 60: optional WorkflowExecutionFailedEventAttributes workflowExecutionFailedEventAttributes\n 70: optional WorkflowExecutionTimedOutEventAttributes workflowExecutionTimedOutEventAttributes\n 80: optional DecisionTaskScheduledEventAttributes decisionTaskScheduledEventAttributes\n 90: optional DecisionTaskStartedEventAttributes decisionTaskStartedEventAttributes\n 100: optional DecisionTaskCompletedEventAttributes decisionTaskCompletedEventAttributes\n 110: optional DecisionTaskTimedOutEventAttributes decisionTaskTimedOutEventAttributes\n 120: optional DecisionTaskFailedEventAttributes decisionTaskFailedEventAttributes\n 130: optional ActivityTaskScheduledEventAttributes activityTaskScheduledEventAttributes\n 140: optional ActivityTaskStartedEventAttributes activityTaskStartedEventAttributes\n 150: optional ActivityTaskCompletedEventAttributes activityTaskCompletedEventAttributes\n 160: optional ActivityTaskFailedEventAttributes activityTaskFailedEventAttributes\n 170: optional ActivityTaskTimedOutEventAttributes activityTaskTimedOutEventAttributes\n 180: optional TimerStartedEventAttributes timerStartedEventAttributes\n 190: optional TimerFiredEventAttributes timerFiredEventAttributes\n 200: optional ActivityTaskCancelRequestedEventAttributes activityTaskCancelRequestedEventAttributes\n 210: optional RequestCancelActivityTaskFailedEventAttributes requestCancelActivityTaskFailedEventAttributes\n 220: optional ActivityTaskCanceledEventAttributes activityTaskCanceledEventAttributes\n 230: optional TimerCanceledEventAttributes timerCanceledEventAttributes\n 240: optional CancelTimerFailedEventAttributes cancelTimerFailedEventAttributes\n 250: optional MarkerRecordedEventAttributes markerRecordedEventAttributes\n 260: optional WorkflowExecutionSignaledEventAttributes workflowExecutionSignaledEventAttributes\n 270: optional WorkflowExecutionTerminatedEventAttributes workflowExecutionTerminatedEventAttributes\n 280: optional WorkflowExecutionCancelRequestedEventAttributes workflowExecutionCancelRequestedEventAttributes\n 290: optional WorkflowExecutionCanceledEventAttributes workflowExecutionCanceledEventAttributes\n 300: optional RequestCancelExternalWorkflowExecutionInitiatedEventAttributes requestCancelExternalWorkflowExecutionInitiatedEventAttributes\n 310: optional RequestCancelExternalWorkflowExecutionFailedEventAttributes requestCancelExternalWorkflowExecutionFailedEventAttributes\n 320: optional ExternalWorkflowExecutionCancelRequestedEventAttributes externalWorkflowExecutionCancelRequestedEventAttributes\n 330: optional WorkflowExecutionContinuedAsNewEventAttributes workflowExecutionContinuedAsNewEventAttributes\n 340: optional StartChildWorkflowExecutionInitiatedEventAttributes startChildWorkflowExecutionInitiatedEventAttributes\n 350: optional StartChildWorkflowExecutionFailedEventAttributes startChildWorkflowExecutionFailedEventAttributes\n 360: optional ChildWorkflowExecutionStartedEventAttributes childWorkflowExecutionStartedEventAttributes\n 370: optional ChildWorkflowExecutionCompletedEventAttributes childWorkflowExecutionCompletedEventAttributes\n 380: optional ChildWorkflowExecutionFailedEventAttributes childWorkflowExecutionFailedEventAttributes\n 390: optional ChildWorkflowExecutionCanceledEventAttributes childWorkflowExecutionCanceledEventAttributes\n 400: optional ChildWorkflowExecutionTimedOutEventAttributes childWorkflowExecutionTimedOutEventAttributes\n 410: optional ChildWorkflowExecutionTerminatedEventAttributes childWorkflowExecutionTerminatedEventAttributes\n}\n\nstruct History {\n 10: optional list events\n}\n\nstruct WorkflowExecutionFilter {\n 10: optional string workflowId\n}\n\nstruct WorkflowTypeFilter {\n 10: optional string name\n}\n\nstruct StartTimeFilter {\n 10: optional i64 (js.type = \"Long\") earliestTime\n 20: optional i64 (js.type = \"Long\") latestTime\n}\n\nstruct DomainInfo {\n 10: optional string name\n 20: optional DomainStatus status\n 30: optional string description\n 40: optional string ownerEmail\n}\n\nstruct DomainConfiguration {\n 10: optional i32 workflowExecutionRetentionPeriodInDays\n 20: optional bool emitMetric\n}\n\nstruct UpdateDomainInfo {\n 10: optional string description\n 20: optional string ownerEmail\n}\n\nstruct RegisterDomainRequest {\n 10: optional string name\n 20: optional string description\n 30: optional string ownerEmail\n 40: optional i32 workflowExecutionRetentionPeriodInDays\n 50: optional bool emitMetric\n}\n\nstruct DescribeDomainRequest {\n 10: optional string name\n}\n\nstruct DescribeDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n}\n\nstruct UpdateDomainRequest {\n 10: optional string name\n 20: optional UpdateDomainInfo updatedInfo\n 30: optional DomainConfiguration configuration\n}\n\nstruct UpdateDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n}\n\nstruct DeprecateDomainRequest {\n 10: optional string name\n}\n\nstruct StartWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional string identity\n 90: optional string requestId\n}\n\nstruct StartWorkflowExecutionResponse {\n 10: optional string runId\n}\n\nstruct PollForDecisionTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n}\n\nstruct PollForDecisionTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") previousStartedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n 54: optional i64 (js.type = \"Long\") backlogCountHint\n 60: optional History history\n 70: optional binary nextPageToken\n 80: optional WorkflowQuery query\n}\n\nstruct StickyExecutionAttributes {\n 10: optional TaskList workerTaskList\n 20: optional i32 scheduleToStartTimeoutSeconds\n}\n\nstruct RespondDecisionTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional list decisions\n 30: optional binary executionContext\n 40: optional string identity\n 50: optional StickyExecutionAttributes stickyAttributes\n}\n\nstruct RespondDecisionTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional DecisionTaskFailedCause cause\n 30: optional binary details\n 40: optional string identity\n}\n\nstruct PollForActivityTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n 40: optional TaskListMetadata taskListMetadata\n}\n\nstruct PollForActivityTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional string activityId\n 40: optional ActivityType activityType\n 50: optional binary input\n 70: optional i64 (js.type = \"Long\") scheduledTimestamp\n 80: optional i32 scheduleToCloseTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") startedTimestamp\n 100: optional i32 startToCloseTimeoutSeconds\n 110: optional i32 heartbeatTimeoutSeconds\n}\n\nstruct RecordActivityTaskHeartbeatRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RecordActivityTaskHeartbeatResponse {\n 10: optional bool cancelRequested\n}\n\nstruct RespondActivityTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional binary result\n 30: optional string identity\n}\n\nstruct RespondActivityTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional string reason\n 30: optional binary details\n 40: optional string identity\n}\n\nstruct RespondActivityTaskCanceledRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RespondActivityTaskCompletedByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary result\n 60: optional string identity\n}\n\nstruct RespondActivityTaskFailedByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional string reason\n 60: optional binary details\n 70: optional string identity\n}\n\nstruct RespondActivityTaskCanceledByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary details\n 60: optional string identity\n}\n\nstruct RequestCancelWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string identity\n 40: optional string requestId\n}\n\nstruct GetWorkflowExecutionHistoryRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional i32 maximumPageSize\n 40: optional binary nextPageToken\n 50: optional bool waitForNewEvent\n}\n\nstruct GetWorkflowExecutionHistoryResponse {\n 10: optional History history\n 20: optional binary nextPageToken\n}\n\nstruct SignalWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string signalName\n 40: optional binary input\n 50: optional string identity\n}\n\nstruct TerminateWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string reason\n 40: optional binary details\n 50: optional string identity\n}\n\nstruct ListOpenWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n}\n\nstruct ListOpenWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct ListClosedWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n 70: optional WorkflowExecutionCloseStatus statusFilter\n}\n\nstruct ListClosedWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct QueryWorkflowRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional WorkflowQuery query\n}\n\nstruct QueryWorkflowResponse {\n 10: optional binary queryResult\n}\n\nstruct WorkflowQuery {\n 10: optional string queryType\n 20: optional binary queryArgs\n}\n\nstruct RespondQueryTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional QueryTaskCompletedType completedType\n 30: optional binary queryResult\n 40: optional string errorMessage\n}\n\nstruct DescribeWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n}\n\nstruct DescribeWorkflowExecutionResponse {\n 10: optional WorkflowExecutionConfiguration executionConfiguration\n 20: optional WorkflowExecutionInfo workflowExecutionInfo\n}\n" +const rawIDL = "// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace java com.uber.cadence\n\nexception BadRequestError {\n 1: required string message\n}\n\nexception InternalServiceError {\n 1: required string message\n}\n\nexception DomainAlreadyExistsError {\n 1: required string message\n}\n\nexception WorkflowExecutionAlreadyStartedError {\n 10: optional string message\n 20: optional string startRequestId\n 30: optional string runId\n}\n\nexception EntityNotExistsError {\n 1: required string message\n}\n\nexception ServiceBusyError {\n 1: required string message\n}\n\nexception CancellationAlreadyRequestedError {\n 1: required string message\n}\n\nexception QueryFailedError {\n 1: required string message\n}\n\nenum DomainStatus {\n REGISTERED,\n DEPRECATED,\n DELETED,\n}\n\nenum TimeoutType {\n START_TO_CLOSE,\n SCHEDULE_TO_START,\n SCHEDULE_TO_CLOSE,\n HEARTBEAT,\n}\n\nenum DecisionType {\n ScheduleActivityTask,\n RequestCancelActivityTask,\n StartTimer,\n CompleteWorkflowExecution,\n FailWorkflowExecution,\n CancelTimer,\n CancelWorkflowExecution,\n RequestCancelExternalWorkflowExecution,\n RecordMarker,\n ContinueAsNewWorkflowExecution,\n StartChildWorkflowExecution,\n}\n\nenum EventType {\n WorkflowExecutionStarted,\n WorkflowExecutionCompleted,\n WorkflowExecutionFailed,\n WorkflowExecutionTimedOut,\n DecisionTaskScheduled,\n DecisionTaskStarted,\n DecisionTaskCompleted,\n DecisionTaskTimedOut\n DecisionTaskFailed,\n ActivityTaskScheduled,\n ActivityTaskStarted,\n ActivityTaskCompleted,\n ActivityTaskFailed,\n ActivityTaskTimedOut,\n ActivityTaskCancelRequested,\n RequestCancelActivityTaskFailed,\n ActivityTaskCanceled,\n TimerStarted,\n TimerFired,\n CancelTimerFailed,\n TimerCanceled,\n WorkflowExecutionCancelRequested,\n WorkflowExecutionCanceled,\n RequestCancelExternalWorkflowExecutionInitiated,\n RequestCancelExternalWorkflowExecutionFailed,\n ExternalWorkflowExecutionCancelRequested,\n MarkerRecorded,\n WorkflowExecutionSignaled,\n WorkflowExecutionTerminated,\n WorkflowExecutionContinuedAsNew,\n StartChildWorkflowExecutionInitiated,\n StartChildWorkflowExecutionFailed,\n ChildWorkflowExecutionStarted,\n ChildWorkflowExecutionCompleted,\n ChildWorkflowExecutionFailed,\n ChildWorkflowExecutionCanceled,\n ChildWorkflowExecutionTimedOut,\n ChildWorkflowExecutionTerminated,\n}\n\nenum DecisionTaskFailedCause {\n UNHANDLED_DECISION,\n BAD_SCHEDULE_ACTIVITY_ATTRIBUTES,\n BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES,\n BAD_START_TIMER_ATTRIBUTES,\n BAD_CANCEL_TIMER_ATTRIBUTES,\n BAD_RECORD_MARKER_ATTRIBUTES,\n BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n BAD_CONTINUE_AS_NEW_ATTRIBUTES,\n START_TIMER_DUPLICATE_ID,\n RESET_STICKY_TASKLIST,\n WORKFLOW_WORKER_UNHANDLED_FAILURE\n}\n\nenum CancelExternalWorkflowExecutionFailedCause {\n UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n}\n\nenum ChildWorkflowExecutionFailedCause {\n WORKFLOW_ALREADY_RUNNING,\n}\n\nenum WorkflowExecutionCloseStatus {\n COMPLETED,\n FAILED,\n CANCELED,\n TERMINATED,\n CONTINUED_AS_NEW,\n TIMED_OUT,\n}\n\nenum ChildPolicy {\n TERMINATE,\n REQUEST_CANCEL,\n ABANDON,\n}\n\nenum QueryTaskCompletedType {\n COMPLETED,\n FAILED,\n}\n\nstruct WorkflowType {\n 10: optional string name\n}\n\nstruct ActivityType {\n 10: optional string name\n}\n\nstruct TaskList {\n 10: optional string name\n}\n\nstruct TaskListMetadata {\n 10: optional double maxTasksPerSecond\n}\n\nstruct WorkflowExecution {\n 10: optional string workflowId\n 20: optional string runId\n}\n\nstruct WorkflowExecutionInfo {\n 10: optional WorkflowExecution execution\n 20: optional WorkflowType type\n 30: optional i64 (js.type = \"Long\") startTime\n 40: optional i64 (js.type = \"Long\") closeTime\n 50: optional WorkflowExecutionCloseStatus closeStatus\n 60: optional i64 (js.type = \"Long\") historyLength\n}\n\nstruct WorkflowExecutionConfiguration {\n 10: optional TaskList taskList\n 20: optional i32 executionStartToCloseTimeoutSeconds\n 30: optional i32 taskStartToCloseTimeoutSeconds\n 40: optional ChildPolicy childPolicy\n}\n\nstruct TransientDecisionInfo {\n 10: optional HistoryEvent scheduledEvent\n 20: optional HistoryEvent startedEvent\n}\n\nstruct ScheduleActivityTaskDecisionAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n}\n\nstruct RequestCancelActivityTaskDecisionAttributes {\n 10: optional string activityId\n}\n\nstruct StartTimerDecisionAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n}\n\nstruct CompleteWorkflowExecutionDecisionAttributes {\n 10: optional binary result\n}\n\nstruct FailWorkflowExecutionDecisionAttributes {\n 10: optional string reason\n 20: optional binary details\n}\n\nstruct CancelTimerDecisionAttributes {\n 10: optional string timerId\n}\n\nstruct CancelWorkflowExecutionDecisionAttributes {\n 10: optional binary details\n}\n\nstruct RequestCancelExternalWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional string runId\n 40: optional binary control\n}\n\nstruct RecordMarkerDecisionAttributes {\n 10: optional string markerName\n 20: optional binary details\n}\n\nstruct ContinueAsNewWorkflowExecutionDecisionAttributes {\n 10: optional WorkflowType workflowType\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n}\n\nstruct StartChildWorkflowExecutionDecisionAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional ChildPolicy childPolicy\n 90: optional binary control\n}\n\nstruct Decision {\n 10: optional DecisionType decisionType\n 20: optional ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes\n 25: optional StartTimerDecisionAttributes startTimerDecisionAttributes\n 30: optional CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes\n 35: optional FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes\n 40: optional RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes\n 50: optional CancelTimerDecisionAttributes cancelTimerDecisionAttributes\n 60: optional CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes\n 70: optional RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes\n 80: optional RecordMarkerDecisionAttributes recordMarkerDecisionAttributes\n 90: optional ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes\n 100: optional StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes\n}\n\nstruct WorkflowExecutionStartedEventAttributes {\n 10: optional WorkflowType workflowType\n 20: optional TaskList taskList\n 30: optional binary input\n 40: optional i32 executionStartToCloseTimeoutSeconds\n 50: optional i32 taskStartToCloseTimeoutSeconds\n 60: optional string identity\n}\n\nstruct WorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n}\n\nstruct WorkflowExecutionContinuedAsNewEventAttributes {\n 10: optional string newExecutionRunId\n 20: optional WorkflowType workflowType\n 30: optional TaskList taskList\n 40: optional binary input\n 50: optional i32 executionStartToCloseTimeoutSeconds\n 60: optional i32 taskStartToCloseTimeoutSeconds\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct DecisionTaskScheduledEventAttributes {\n 10: optional TaskList taskList\n 20: optional i32 startToCloseTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") attempt\n}\n\nstruct DecisionTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n}\n\nstruct DecisionTaskCompletedEventAttributes {\n 10: optional binary executionContext\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n}\n\nstruct DecisionTaskTimedOutEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n}\n\nstruct DecisionTaskFailedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional DecisionTaskFailedCause cause\n 35: optional binary details\n 40: optional string identity\n}\n\nstruct ActivityTaskScheduledEventAttributes {\n 10: optional string activityId\n 20: optional ActivityType activityType\n 25: optional string domain\n 30: optional TaskList taskList\n 40: optional binary input\n 45: optional i32 scheduleToCloseTimeoutSeconds\n 50: optional i32 scheduleToStartTimeoutSeconds\n 55: optional i32 startToCloseTimeoutSeconds\n 60: optional i32 heartbeatTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskStartedEventAttributes {\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional string identity\n 30: optional string requestId\n}\n\nstruct ActivityTaskCompletedEventAttributes {\n 10: optional binary result\n 20: optional i64 (js.type = \"Long\") scheduledEventId\n 30: optional i64 (js.type = \"Long\") startedEventId\n 40: optional string identity\n}\n\nstruct ActivityTaskFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct ActivityTaskTimedOutEventAttributes {\n 05: optional binary details\n 10: optional i64 (js.type = \"Long\") scheduledEventId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional TimeoutType timeoutType\n}\n\nstruct ActivityTaskCancelRequestedEventAttributes {\n 10: optional string activityId\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct RequestCancelActivityTaskFailedEventAttributes{\n 10: optional string activityId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskCanceledEventAttributes {\n 10: optional binary details\n 20: optional i64 (js.type = \"Long\") latestCancelRequestedEventId\n 30: optional i64 (js.type = \"Long\") scheduledEventId\n 40: optional i64 (js.type = \"Long\") startedEventId\n 50: optional string identity\n}\n\nstruct TimerStartedEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct TimerFiredEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct TimerCanceledEventAttributes {\n 10: optional string timerId\n 20: optional i64 (js.type = \"Long\") startedEventId\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct CancelTimerFailedEventAttributes {\n 10: optional string timerId\n 20: optional string cause\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 40: optional string identity\n}\n\nstruct WorkflowExecutionCancelRequestedEventAttributes {\n 10: optional string cause\n 20: optional i64 (js.type = \"Long\") externalInitiatedEventId\n 30: optional WorkflowExecution externalWorkflowExecution\n 40: optional string identity\n}\n\nstruct WorkflowExecutionCanceledEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional binary details\n}\n\nstruct MarkerRecordedEventAttributes {\n 10: optional string markerName\n 20: optional binary details\n 30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionSignaledEventAttributes {\n 10: optional string signalName\n 20: optional binary input\n 30: optional string identity\n}\n\nstruct WorkflowExecutionTerminatedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RequestCancelExternalWorkflowExecutionInitiatedEventAttributes {\n 10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional binary control\n}\n\nstruct RequestCancelExternalWorkflowExecutionFailedEventAttributes {\n 10: optional CancelExternalWorkflowExecutionFailedCause cause\n 20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionCancelRequestedEventAttributes {\n 10: optional i64 (js.type = \"Long\") initiatedEventId\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n}\n\nstruct StartChildWorkflowExecutionInitiatedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional ChildPolicy childPolicy\n 90: optional binary control\n 100: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct StartChildWorkflowExecutionFailedEventAttributes {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional ChildWorkflowExecutionFailedCause cause\n 50: optional binary control\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ChildWorkflowExecutionStartedEventAttributes {\n 10: optional string domain\n 20: optional i64 (js.type = \"Long\") initiatedEventId\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n}\n\nstruct ChildWorkflowExecutionCompletedEventAttributes {\n 10: optional binary result\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionFailedEventAttributes {\n 10: optional string reason\n 20: optional binary details\n 30: optional string domain\n 40: optional WorkflowExecution workflowExecution\n 50: optional WorkflowType workflowType\n 60: optional i64 (js.type = \"Long\") initiatedEventId\n 70: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionCanceledEventAttributes {\n 10: optional binary details\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTimedOutEventAttributes {\n 10: optional TimeoutType timeoutType\n 20: optional string domain\n 30: optional WorkflowExecution workflowExecution\n 40: optional WorkflowType workflowType\n 50: optional i64 (js.type = \"Long\") initiatedEventId\n 60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTerminatedEventAttributes {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") initiatedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct HistoryEvent {\n 10: optional i64 (js.type = \"Long\") eventId\n 20: optional i64 (js.type = \"Long\") timestamp\n 30: optional EventType eventType\n 40: optional WorkflowExecutionStartedEventAttributes workflowExecutionStartedEventAttributes\n 50: optional WorkflowExecutionCompletedEventAttributes workflowExecutionCompletedEventAttributes\n 60: optional WorkflowExecutionFailedEventAttributes workflowExecutionFailedEventAttributes\n 70: optional WorkflowExecutionTimedOutEventAttributes workflowExecutionTimedOutEventAttributes\n 80: optional DecisionTaskScheduledEventAttributes decisionTaskScheduledEventAttributes\n 90: optional DecisionTaskStartedEventAttributes decisionTaskStartedEventAttributes\n 100: optional DecisionTaskCompletedEventAttributes decisionTaskCompletedEventAttributes\n 110: optional DecisionTaskTimedOutEventAttributes decisionTaskTimedOutEventAttributes\n 120: optional DecisionTaskFailedEventAttributes decisionTaskFailedEventAttributes\n 130: optional ActivityTaskScheduledEventAttributes activityTaskScheduledEventAttributes\n 140: optional ActivityTaskStartedEventAttributes activityTaskStartedEventAttributes\n 150: optional ActivityTaskCompletedEventAttributes activityTaskCompletedEventAttributes\n 160: optional ActivityTaskFailedEventAttributes activityTaskFailedEventAttributes\n 170: optional ActivityTaskTimedOutEventAttributes activityTaskTimedOutEventAttributes\n 180: optional TimerStartedEventAttributes timerStartedEventAttributes\n 190: optional TimerFiredEventAttributes timerFiredEventAttributes\n 200: optional ActivityTaskCancelRequestedEventAttributes activityTaskCancelRequestedEventAttributes\n 210: optional RequestCancelActivityTaskFailedEventAttributes requestCancelActivityTaskFailedEventAttributes\n 220: optional ActivityTaskCanceledEventAttributes activityTaskCanceledEventAttributes\n 230: optional TimerCanceledEventAttributes timerCanceledEventAttributes\n 240: optional CancelTimerFailedEventAttributes cancelTimerFailedEventAttributes\n 250: optional MarkerRecordedEventAttributes markerRecordedEventAttributes\n 260: optional WorkflowExecutionSignaledEventAttributes workflowExecutionSignaledEventAttributes\n 270: optional WorkflowExecutionTerminatedEventAttributes workflowExecutionTerminatedEventAttributes\n 280: optional WorkflowExecutionCancelRequestedEventAttributes workflowExecutionCancelRequestedEventAttributes\n 290: optional WorkflowExecutionCanceledEventAttributes workflowExecutionCanceledEventAttributes\n 300: optional RequestCancelExternalWorkflowExecutionInitiatedEventAttributes requestCancelExternalWorkflowExecutionInitiatedEventAttributes\n 310: optional RequestCancelExternalWorkflowExecutionFailedEventAttributes requestCancelExternalWorkflowExecutionFailedEventAttributes\n 320: optional ExternalWorkflowExecutionCancelRequestedEventAttributes externalWorkflowExecutionCancelRequestedEventAttributes\n 330: optional WorkflowExecutionContinuedAsNewEventAttributes workflowExecutionContinuedAsNewEventAttributes\n 340: optional StartChildWorkflowExecutionInitiatedEventAttributes startChildWorkflowExecutionInitiatedEventAttributes\n 350: optional StartChildWorkflowExecutionFailedEventAttributes startChildWorkflowExecutionFailedEventAttributes\n 360: optional ChildWorkflowExecutionStartedEventAttributes childWorkflowExecutionStartedEventAttributes\n 370: optional ChildWorkflowExecutionCompletedEventAttributes childWorkflowExecutionCompletedEventAttributes\n 380: optional ChildWorkflowExecutionFailedEventAttributes childWorkflowExecutionFailedEventAttributes\n 390: optional ChildWorkflowExecutionCanceledEventAttributes childWorkflowExecutionCanceledEventAttributes\n 400: optional ChildWorkflowExecutionTimedOutEventAttributes childWorkflowExecutionTimedOutEventAttributes\n 410: optional ChildWorkflowExecutionTerminatedEventAttributes childWorkflowExecutionTerminatedEventAttributes\n}\n\nstruct History {\n 10: optional list events\n}\n\nstruct WorkflowExecutionFilter {\n 10: optional string workflowId\n}\n\nstruct WorkflowTypeFilter {\n 10: optional string name\n}\n\nstruct StartTimeFilter {\n 10: optional i64 (js.type = \"Long\") earliestTime\n 20: optional i64 (js.type = \"Long\") latestTime\n}\n\nstruct DomainInfo {\n 10: optional string name\n 20: optional DomainStatus status\n 30: optional string description\n 40: optional string ownerEmail\n}\n\nstruct DomainConfiguration {\n 10: optional i32 workflowExecutionRetentionPeriodInDays\n 20: optional bool emitMetric\n}\n\nstruct UpdateDomainInfo {\n 10: optional string description\n 20: optional string ownerEmail\n}\n\nstruct RegisterDomainRequest {\n 10: optional string name\n 20: optional string description\n 30: optional string ownerEmail\n 40: optional i32 workflowExecutionRetentionPeriodInDays\n 50: optional bool emitMetric\n}\n\nstruct DescribeDomainRequest {\n 10: optional string name\n}\n\nstruct DescribeDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n}\n\nstruct UpdateDomainRequest {\n 10: optional string name\n 20: optional UpdateDomainInfo updatedInfo\n 30: optional DomainConfiguration configuration\n}\n\nstruct UpdateDomainResponse {\n 10: optional DomainInfo domainInfo\n 20: optional DomainConfiguration configuration\n}\n\nstruct DeprecateDomainRequest {\n 10: optional string name\n}\n\nstruct StartWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional string workflowId\n 30: optional WorkflowType workflowType\n 40: optional TaskList taskList\n 50: optional binary input\n 60: optional i32 executionStartToCloseTimeoutSeconds\n 70: optional i32 taskStartToCloseTimeoutSeconds\n 80: optional string identity\n 90: optional string requestId\n}\n\nstruct StartWorkflowExecutionResponse {\n 10: optional string runId\n}\n\nstruct PollForDecisionTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n}\n\nstruct PollForDecisionTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional WorkflowType workflowType\n 40: optional i64 (js.type = \"Long\") previousStartedEventId\n 50: optional i64 (js.type = \"Long\") startedEventId\n 54: optional i64 (js.type = \"Long\") backlogCountHint\n 60: optional History history\n 70: optional binary nextPageToken\n 80: optional WorkflowQuery query\n}\n\nstruct StickyExecutionAttributes {\n 10: optional TaskList workerTaskList\n 20: optional i32 scheduleToStartTimeoutSeconds\n}\n\nstruct RespondDecisionTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional list decisions\n 30: optional binary executionContext\n 40: optional string identity\n 50: optional StickyExecutionAttributes stickyAttributes\n}\n\nstruct RespondDecisionTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional DecisionTaskFailedCause cause\n 30: optional binary details\n 40: optional string identity\n}\n\nstruct PollForActivityTaskRequest {\n 10: optional string domain\n 20: optional TaskList taskList\n 30: optional string identity\n 40: optional TaskListMetadata taskListMetadata\n}\n\nstruct PollForActivityTaskResponse {\n 10: optional binary taskToken\n 20: optional WorkflowExecution workflowExecution\n 30: optional string activityId\n 40: optional ActivityType activityType\n 50: optional binary input\n 70: optional i64 (js.type = \"Long\") scheduledTimestamp\n 80: optional i32 scheduleToCloseTimeoutSeconds\n 90: optional i64 (js.type = \"Long\") startedTimestamp\n 100: optional i32 startToCloseTimeoutSeconds\n 110: optional i32 heartbeatTimeoutSeconds\n}\n\nstruct RecordActivityTaskHeartbeatRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RecordActivityTaskHeartbeatResponse {\n 10: optional bool cancelRequested\n}\n\nstruct RespondActivityTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional binary result\n 30: optional string identity\n}\n\nstruct RespondActivityTaskFailedRequest {\n 10: optional binary taskToken\n 20: optional string reason\n 30: optional binary details\n 40: optional string identity\n}\n\nstruct RespondActivityTaskCanceledRequest {\n 10: optional binary taskToken\n 20: optional binary details\n 30: optional string identity\n}\n\nstruct RespondActivityTaskCompletedByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary result\n 60: optional string identity\n}\n\nstruct RespondActivityTaskFailedByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional string reason\n 60: optional binary details\n 70: optional string identity\n}\n\nstruct RespondActivityTaskCanceledByIDRequest {\n 10: optional string domainID\n 20: optional string workflowID\n 30: optional string runID\n 40: optional string activityID\n 50: optional binary details\n 60: optional string identity\n}\n\nstruct RequestCancelWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string identity\n 40: optional string requestId\n}\n\nstruct GetWorkflowExecutionHistoryRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional i32 maximumPageSize\n 40: optional binary nextPageToken\n 50: optional bool waitForNewEvent\n}\n\nstruct GetWorkflowExecutionHistoryResponse {\n 10: optional History history\n 20: optional binary nextPageToken\n}\n\nstruct SignalWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string signalName\n 40: optional binary input\n 50: optional string identity\n}\n\nstruct TerminateWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution workflowExecution\n 30: optional string reason\n 40: optional binary details\n 50: optional string identity\n}\n\nstruct ListOpenWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n}\n\nstruct ListOpenWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct ListClosedWorkflowExecutionsRequest {\n 10: optional string domain\n 20: optional i32 maximumPageSize\n 30: optional binary nextPageToken\n 40: optional StartTimeFilter StartTimeFilter\n 50: optional WorkflowExecutionFilter executionFilter\n 60: optional WorkflowTypeFilter typeFilter\n 70: optional WorkflowExecutionCloseStatus statusFilter\n}\n\nstruct ListClosedWorkflowExecutionsResponse {\n 10: optional list executions\n 20: optional binary nextPageToken\n}\n\nstruct QueryWorkflowRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n 30: optional WorkflowQuery query\n}\n\nstruct QueryWorkflowResponse {\n 10: optional binary queryResult\n}\n\nstruct WorkflowQuery {\n 10: optional string queryType\n 20: optional binary queryArgs\n}\n\nstruct RespondQueryTaskCompletedRequest {\n 10: optional binary taskToken\n 20: optional QueryTaskCompletedType completedType\n 30: optional binary queryResult\n 40: optional string errorMessage\n}\n\nstruct DescribeWorkflowExecutionRequest {\n 10: optional string domain\n 20: optional WorkflowExecution execution\n}\n\nstruct DescribeWorkflowExecutionResponse {\n 10: optional WorkflowExecutionConfiguration executionConfiguration\n 20: optional WorkflowExecutionInfo workflowExecutionInfo\n}\n" diff --git a/.gen/go/shared/types.go b/.gen/go/shared/types.go index c9b2153b424..51b3444e560 100644 --- a/.gen/go/shared/types.go +++ b/.gen/go/shared/types.go @@ -23098,8 +23098,6 @@ type WorkflowExecutionConfiguration struct { ExecutionStartToCloseTimeoutSeconds *int32 `json:"executionStartToCloseTimeoutSeconds,omitempty"` TaskStartToCloseTimeoutSeconds *int32 `json:"taskStartToCloseTimeoutSeconds,omitempty"` ChildPolicy *ChildPolicy `json:"childPolicy,omitempty"` - StickyTaskList *TaskList `json:"stickyTaskList,omitempty"` - StickyScheduleToStartTimeoutSeconds *int32 `json:"stickyScheduleToStartTimeoutSeconds,omitempty"` } // ToWire translates a WorkflowExecutionConfiguration struct into a Thrift-level intermediate @@ -23119,7 +23117,7 @@ type WorkflowExecutionConfiguration struct { // } func (v *WorkflowExecutionConfiguration) ToWire() (wire.Value, error) { var ( - fields [6]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error @@ -23157,22 +23155,6 @@ func (v *WorkflowExecutionConfiguration) ToWire() (wire.Value, error) { fields[i] = wire.Field{ID: 40, Value: w} i++ } - if v.StickyTaskList != nil { - w, err = v.StickyTaskList.ToWire() - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 50, Value: w} - i++ - } - if v.StickyScheduleToStartTimeoutSeconds != nil { - w, err = wire.NewValueI32(*(v.StickyScheduleToStartTimeoutSeconds)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 60, Value: w} - i++ - } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } @@ -23236,24 +23218,6 @@ func (v *WorkflowExecutionConfiguration) FromWire(w wire.Value) error { return err } - } - case 50: - if field.Value.Type() == wire.TStruct { - v.StickyTaskList, err = _TaskList_Read(field.Value) - if err != nil { - return err - } - - } - case 60: - if field.Value.Type() == wire.TI32 { - var x int32 - x, err = field.Value.GetI32(), error(nil) - v.StickyScheduleToStartTimeoutSeconds = &x - if err != nil { - return err - } - } } } @@ -23268,7 +23232,7 @@ func (v *WorkflowExecutionConfiguration) String() string { return "" } - var fields [6]string + var fields [4]string i := 0 if v.TaskList != nil { fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList) @@ -23286,14 +23250,6 @@ func (v *WorkflowExecutionConfiguration) String() string { fields[i] = fmt.Sprintf("ChildPolicy: %v", *(v.ChildPolicy)) i++ } - if v.StickyTaskList != nil { - fields[i] = fmt.Sprintf("StickyTaskList: %v", v.StickyTaskList) - i++ - } - if v.StickyScheduleToStartTimeoutSeconds != nil { - fields[i] = fmt.Sprintf("StickyScheduleToStartTimeoutSeconds: %v", *(v.StickyScheduleToStartTimeoutSeconds)) - i++ - } return fmt.Sprintf("WorkflowExecutionConfiguration{%v}", strings.Join(fields[:i], ", ")) } @@ -23315,12 +23271,6 @@ func (v *WorkflowExecutionConfiguration) Equals(rhs *WorkflowExecutionConfigurat if !_ChildPolicy_EqualsPtr(v.ChildPolicy, rhs.ChildPolicy) { return false } - if !((v.StickyTaskList == nil && rhs.StickyTaskList == nil) || (v.StickyTaskList != nil && rhs.StickyTaskList != nil && v.StickyTaskList.Equals(rhs.StickyTaskList))) { - return false - } - if !_I32_EqualsPtr(v.StickyScheduleToStartTimeoutSeconds, rhs.StickyScheduleToStartTimeoutSeconds) { - return false - } return true } @@ -23355,16 +23305,6 @@ func (v *WorkflowExecutionConfiguration) GetChildPolicy() (o ChildPolicy) { return } -// GetStickyScheduleToStartTimeoutSeconds returns the value of StickyScheduleToStartTimeoutSeconds if it is set or its -// zero value if it is unset. -func (v *WorkflowExecutionConfiguration) GetStickyScheduleToStartTimeoutSeconds() (o int32) { - if v.StickyScheduleToStartTimeoutSeconds != nil { - return *v.StickyScheduleToStartTimeoutSeconds - } - - return -} - type WorkflowExecutionContinuedAsNewEventAttributes struct { NewExecutionRunId *string `json:"newExecutionRunId,omitempty"` WorkflowType *WorkflowType `json:"workflowType,omitempty"` diff --git a/Makefile b/Makefile index 00c1f469f73..281a41ce4de 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ test: vendor/glide.updated bins @rm -f test @rm -f test.log @for dir in $(TEST_DIRS); do \ - go test -race -coverprofile=$@ "$$dir" | tee -a test.log; \ + go test -coverprofile=$@ "$$dir" | tee -a test.log; \ done; cover_profile: clean bins_nothrift @@ -99,7 +99,7 @@ cover_profile: clean bins_nothrift @echo "mode: atomic" > $(BUILD)/cover.out @echo Running integration test - @mkdir -p $(BUILD)/$(INTEG_TEST_DIR) + @mkdir -p $(BUILD)/$(INTEG_TEST_DIR) @time go test $(INTEG_TEST_ROOT) $(TEST_ARG) $(GOCOVERPKG_ARG) -coverprofile=$(BUILD)/$(INTEG_TEST_DIR)/coverage.out || exit 1; @cat $(BUILD)/$(INTEG_TEST_DIR)/coverage.out | grep -v "mode: atomic" >> $(BUILD)/cover.out diff --git a/host/integration_test.go b/host/integration_test.go index bbc0b812724..87d48db5d0f 100644 --- a/host/integration_test.go +++ b/host/integration_test.go @@ -78,17 +78,15 @@ type ( queryHandler func(task *workflow.PollForDecisionTaskResponse) ([]byte, error) taskPoller struct { - engine frontend.Client - domain string - taskList *workflow.TaskList - sticktTaskList *workflow.TaskList - stickyScheduleToStartTimeoutSeconds *int32 - identity string - decisionHandler decisionTaskHandler - activityHandler activityTaskHandler - queryHandler queryHandler - logger bark.Logger - suite *integrationSuite + engine frontend.Client + domain string + taskList *workflow.TaskList + identity string + decisionHandler decisionTaskHandler + activityHandler activityTaskHandler + queryHandler queryHandler + logger bark.Logger + suite *integrationSuite } ) @@ -289,7 +287,7 @@ func (s *integrationSuite) TestTerminateWorkflow() { suite: s, } - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -461,7 +459,7 @@ func (s *integrationSuite) TestSequentialWorkflow() { } for i := 0; i < 10; i++ { - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) err = poller.pollAndProcessActivityTask(false) @@ -470,116 +468,68 @@ func (s *integrationSuite) TestSequentialWorkflow() { } s.False(workflowComplete) - _, err := poller.pollAndProcessDecisionTask(true, false) - s.Nil(err) + s.Nil(poller.pollAndProcessDecisionTask(true, false)) s.True(workflowComplete) } -func (p *taskPoller) pollAndProcessDecisionTask(dumpHistory bool, dropTask bool) (isQueryTask bool, err error) { - return p.pollAndProcessDecisionTaskWithAttempt(dumpHistory, dropTask, false, false, int64(0)) -} - -func (p *taskPoller) pollAndProcessDecisionTaskWithSticky(dumpHistory bool, dropTask bool) (isQueryTask bool, err error) { - return p.pollAndProcessDecisionTaskWithAttempt(dumpHistory, dropTask, true, true, int64(0)) +func (p *taskPoller) pollAndProcessDecisionTask(dumpHistory bool, dropTask bool) error { + return p.pollAndProcessDecisionTaskWithAttempt(dumpHistory, dropTask, int64(0)) } func (p *taskPoller) pollAndProcessDecisionTaskWithAttempt(dumpHistory bool, dropTask bool, - pollStickyTaskList bool, respondStickyTaskList bool, decisionAttempt int64) (isQueryTask bool, err error) { -Loop: + decisionAttempt int64) error { +retry: for attempt := 0; attempt < 5; attempt++ { - - taskList := p.taskList - if pollStickyTaskList { - taskList = p.sticktTaskList - } response, err1 := p.engine.PollForDecisionTask(createContext(), &workflow.PollForDecisionTaskRequest{ Domain: common.StringPtr(p.domain), - TaskList: taskList, + TaskList: p.taskList, Identity: common.StringPtr(p.identity), }) if err1 == history.ErrDuplicate { p.logger.Info("Duplicate Decision task: Polling again.") - continue Loop + continue retry } if err1 != nil { - return false, err1 + return err1 } if response == nil || len(response.TaskToken) == 0 { p.logger.Info("Empty Decision task: Polling again.") - continue Loop + continue retry } - var events []*workflow.HistoryEvent - if response.Query == nil || !pollStickyTaskList { - // if not query task, should have some history events - // for non sticky query, there should be events returned - history := response.History - if history == nil { - p.logger.Fatal("History is nil") - } - - events = history.Events - if events == nil || len(events) == 0 { - p.logger.Fatalf("History Events are empty: %v", events) - } + history := response.History + if history == nil { + p.logger.Fatal("History is nil") + } - nextPageToken := response.NextPageToken - for nextPageToken != nil { - resp, err2 := p.engine.GetWorkflowExecutionHistory(createContext(), &workflow.GetWorkflowExecutionHistoryRequest{ - Domain: common.StringPtr(p.domain), - Execution: response.WorkflowExecution, - NextPageToken: nextPageToken, - }) + events := history.Events + if events == nil || len(events) == 0 { + p.logger.Fatalf("History Events are empty: %v", events) + } - if err2 != nil { - return false, err2 - } + nextPageToken := response.NextPageToken + for nextPageToken != nil { + resp, err2 := p.engine.GetWorkflowExecutionHistory(createContext(), &workflow.GetWorkflowExecutionHistoryRequest{ + Domain: common.StringPtr(p.domain), + Execution: response.WorkflowExecution, + NextPageToken: nextPageToken, + }) - events = append(events, resp.History.Events...) - nextPageToken = resp.NextPageToken - } - } else { - // for sticky query, there should be NO events returned - // since worker side already has the state machine and we do not intend to update that. - history := response.History - nextPageToken := response.NextPageToken - if !(history == nil || (len(history.Events) == 0 && nextPageToken == nil)) { - // if history is not nil, and contains events or next token - p.logger.Fatal("History is not empty for sticky query") + if err2 != nil { + return err2 } - } - if dropTask { - p.logger.Info("Dropping Decision task: ") - return false, nil + events = append(events, resp.History.Events...) + nextPageToken = resp.NextPageToken } if dumpHistory { common.PrettyPrintHistory(response.History, p.logger) } - // handle query task response - if response.Query != nil { - blob, err := p.queryHandler(response) - - completeRequest := &workflow.RespondQueryTaskCompletedRequest{TaskToken: response.TaskToken} - if err != nil { - completeType := workflow.QueryTaskCompletedTypeFailed - completeRequest.CompletedType = &completeType - completeRequest.ErrorMessage = common.StringPtr(err.Error()) - } else { - completeType := workflow.QueryTaskCompletedTypeCompleted - completeRequest.CompletedType = &completeType - completeRequest.QueryResult = blob - } - - return true, p.engine.RespondQueryTaskCompleted(createContext(), completeRequest) - } - - // handle normal decirsion task / non query task response var lastDecisionScheduleEvent *workflow.HistoryEvent for _, e := range events { if e.GetEventType() == workflow.EventTypeDecisionTaskScheduled { @@ -590,11 +540,17 @@ Loop: p.suite.Equal(decisionAttempt, lastDecisionScheduleEvent.DecisionTaskScheduledEventAttributes.GetAttempt()) } + if dropTask { + p.logger.Info("Dropping Decision task...") + return nil + } + + // process decision executionCtx, decisions, err := p.decisionHandler(response.WorkflowExecution, response.WorkflowType, common.Int64Default(response.PreviousStartedEventId), common.Int64Default(response.StartedEventId), response.History) if err != nil { p.logger.Infof("Failing Decision. Decision handler failed with error: %v", err) - return isQueryTask, p.engine.RespondDecisionTaskFailed(createContext(), &workflow.RespondDecisionTaskFailedRequest{ + return p.engine.RespondDecisionTaskFailed(createContext(), &workflow.RespondDecisionTaskFailedRequest{ TaskToken: response.TaskToken, Cause: common.DecisionTaskFailedCausePtr(workflow.DecisionTaskFailedCauseWorkflowWorkerUnhandledFailure), Details: []byte(err.Error()), @@ -603,29 +559,92 @@ Loop: } p.logger.Infof("Completing Decision. Decisions: %v", decisions) - if !respondStickyTaskList { - // non sticky tasklist - return false, p.engine.RespondDecisionTaskCompleted(createContext(), &workflow.RespondDecisionTaskCompletedRequest{ - TaskToken: response.TaskToken, - Identity: common.StringPtr(p.identity), - ExecutionContext: executionCtx, - Decisions: decisions, - }) - } - // sticky tasklist - return false, p.engine.RespondDecisionTaskCompleted(createContext(), &workflow.RespondDecisionTaskCompletedRequest{ + return p.engine.RespondDecisionTaskCompleted(createContext(), &workflow.RespondDecisionTaskCompletedRequest{ TaskToken: response.TaskToken, Identity: common.StringPtr(p.identity), ExecutionContext: executionCtx, Decisions: decisions, - StickyAttributes: &workflow.StickyExecutionAttributes{ - WorkerTaskList: p.sticktTaskList, - ScheduleToStartTimeoutSeconds: p.stickyScheduleToStartTimeoutSeconds, - }, }) } - return false, matching.ErrNoTasks + return matching.ErrNoTasks +} + +func (p *taskPoller) pollAndProcessQueryTask(dumpHistory bool, dropTask bool) error { +retry: + for attempt := 0; attempt < 5; attempt++ { + response, err1 := p.engine.PollForDecisionTask(createContext(), &workflow.PollForDecisionTaskRequest{ + Domain: common.StringPtr(p.domain), + TaskList: p.taskList, + Identity: common.StringPtr(p.identity), + }) + + if err1 == history.ErrDuplicate { + p.logger.Info("Duplicate Decision task: Polling again.") + continue retry + } + + if err1 != nil { + return err1 + } + + if response == nil || len(response.TaskToken) == 0 { + p.logger.Info("Empty Decision task: Polling again.") + continue retry + } + + history := response.History + if history == nil { + p.logger.Fatal("History is nil") + } + + events := history.Events + if events == nil || len(events) == 0 { + p.logger.Fatalf("History Events are empty: %v", events) + } + + nextPageToken := response.NextPageToken + for nextPageToken != nil { + resp, err2 := p.engine.GetWorkflowExecutionHistory(createContext(), &workflow.GetWorkflowExecutionHistoryRequest{ + Domain: common.StringPtr(p.domain), + Execution: response.WorkflowExecution, + NextPageToken: nextPageToken, + }) + + if err2 != nil { + return err2 + } + + events = append(events, resp.History.Events...) + nextPageToken = resp.NextPageToken + } + + if dropTask { + p.logger.Info("Dropping Decision task: ") + return nil + } + + if dumpHistory { + common.PrettyPrintHistory(response.History, p.logger) + } + + blob, err := p.queryHandler(response) + + completeRequest := &workflow.RespondQueryTaskCompletedRequest{TaskToken: response.TaskToken} + if err != nil { + completeType := workflow.QueryTaskCompletedTypeFailed + completeRequest.CompletedType = &completeType + completeRequest.ErrorMessage = common.StringPtr(err.Error()) + } else { + completeType := workflow.QueryTaskCompletedTypeCompleted + completeRequest.CompletedType = &completeType + completeRequest.QueryResult = blob + } + + return p.engine.RespondQueryTaskCompleted(createContext(), completeRequest) + } + + return matching.ErrNoTasks } func (p *taskPoller) pollAndProcessActivityTask(dropTask bool) error { @@ -777,9 +796,9 @@ func (s *integrationSuite) TestDecisionAndActivityTimeoutsWorkflow() { s.logger.Infof("Calling Decision Task: %d", i) var err error if dropDecisionTask { - _, err = poller.pollAndProcessDecisionTask(true, true) + err = poller.pollAndProcessDecisionTask(true, true) } else { - _, err = poller.pollAndProcessDecisionTaskWithAttempt(true, false, false, false, int64(1)) + err = poller.pollAndProcessDecisionTaskWithAttempt(true, false, int64(1)) } if err != nil { historyResponse, err := s.engine.GetWorkflowExecutionHistory(createContext(), &workflow.GetWorkflowExecutionHistoryRequest{ @@ -804,8 +823,7 @@ func (s *integrationSuite) TestDecisionAndActivityTimeoutsWorkflow() { s.logger.Infof("Waiting for workflow to complete: RunId: %v", *we.RunId) s.False(workflowComplete) - _, err := poller.pollAndProcessDecisionTask(true, false) - s.Nil(err) + s.Nil(poller.pollAndProcessDecisionTask(true, false)) s.True(workflowComplete) } @@ -903,7 +921,7 @@ func (s *integrationSuite) TestActivityHeartBeatWorkflow_Success() { suite: s, } - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.True(err == nil || err == matching.ErrNoTasks) err = poller.pollAndProcessActivityTask(false) @@ -912,8 +930,7 @@ func (s *integrationSuite) TestActivityHeartBeatWorkflow_Success() { s.logger.Infof("Waiting for workflow to complete: RunId: %v", *we.RunId) s.False(workflowComplete) - _, err = poller.pollAndProcessDecisionTask(true, false) - s.Nil(err) + s.Nil(poller.pollAndProcessDecisionTask(true, false)) s.True(workflowComplete) s.True(activityExecutedCount == 1) } @@ -1008,7 +1025,7 @@ func (s *integrationSuite) TestActivityHeartBeatWorkflow_Timeout() { suite: s, } - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.True(err == nil || err == matching.ErrNoTasks) err = poller.pollAndProcessActivityTask(false) @@ -1016,8 +1033,7 @@ func (s *integrationSuite) TestActivityHeartBeatWorkflow_Timeout() { s.logger.Infof("Waiting for workflow to complete: RunId: %v", *we.RunId) s.False(workflowComplete) - _, err = poller.pollAndProcessDecisionTask(true, false) - s.Nil(err) + s.Nil(poller.pollAndProcessDecisionTask(true, false)) s.True(workflowComplete) } @@ -1089,14 +1105,13 @@ func (s *integrationSuite) TestSequential_UserTimers() { } for i := 0; i < 4; i++ { - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Info("pollAndProcessDecisionTask: completed") s.Nil(err) } s.False(workflowComplete) - _, err := poller.pollAndProcessDecisionTask(true, false) - s.Nil(err) + s.Nil(poller.pollAndProcessDecisionTask(true, false)) s.True(workflowComplete) } @@ -1206,7 +1221,7 @@ func (s *integrationSuite) TestActivityCancelation() { suite: s, } - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.True(err == nil || err == matching.ErrNoTasks) cancelCh := make(chan struct{}) @@ -1215,7 +1230,7 @@ func (s *integrationSuite) TestActivityCancelation() { s.logger.Info("Trying to cancel the task in a different thread.") scheduleActivity = false requestCancellation = true - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.True(err == nil || err == matching.ErrNoTasks) cancelCh <- struct{}{} }() @@ -1335,7 +1350,7 @@ func (s *integrationSuite) TestSignalWorkflow() { } // Make first decision to schedule activity - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -1355,7 +1370,7 @@ func (s *integrationSuite) TestSignalWorkflow() { s.Nil(err) // Process signal in decider - _, err = poller.pollAndProcessDecisionTask(true, false) + err = poller.pollAndProcessDecisionTask(true, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -1380,7 +1395,7 @@ func (s *integrationSuite) TestSignalWorkflow() { s.Nil(err) // Process signal in decider - _, err = poller.pollAndProcessDecisionTask(true, false) + err = poller.pollAndProcessDecisionTask(true, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -1508,7 +1523,7 @@ func (s *integrationSuite) TestBufferedEvents() { } // first decision, which sends signal and the signal event should be buffered to append after first decision closed - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -1528,7 +1543,7 @@ func (s *integrationSuite) TestBufferedEvents() { s.Equal(histResp.History.Events[5].GetEventType(), workflow.EventTypeWorkflowExecutionSignaled) // Process signal in decider - _, err = poller.pollAndProcessDecisionTask(true, false) + err = poller.pollAndProcessDecisionTask(true, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) s.NotNil(signalEvent) @@ -1537,196 +1552,7 @@ func (s *integrationSuite) TestBufferedEvents() { s.True(workflowComplete) } -func (s *integrationSuite) TestQueryWorkflow_Sticky() { - fmt.Println("$$$$$$$$$$$$$$$$$$$$$$$$$$") - id := "interation-query-workflow-test" - wt := "interation-query-workflow-test-type" - tl := "interation-query-workflow-test-tasklist" - stl := "interation-query-workflow-test-tasklist-sticky" - identity := "worker1" - activityName := "activity_type1" - queryType := "test-query" - - workflowType := &workflow.WorkflowType{} - workflowType.Name = common.StringPtr(wt) - - taskList := &workflow.TaskList{} - taskList.Name = common.StringPtr(tl) - - stickyTaskList := &workflow.TaskList{} - stickyTaskList.Name = common.StringPtr(stl) - stickyScheduleToStartTimeoutSeconds := common.Int32Ptr(10) - - // Start workflow execution - request := &workflow.StartWorkflowExecutionRequest{ - RequestId: common.StringPtr(uuid.New()), - Domain: common.StringPtr(s.domainName), - WorkflowId: common.StringPtr(id), - WorkflowType: workflowType, - TaskList: taskList, - Input: nil, - ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(100), - TaskStartToCloseTimeoutSeconds: common.Int32Ptr(1), - Identity: common.StringPtr(identity), - } - - we, err0 := s.engine.StartWorkflowExecution(createContext(), request) - s.Nil(err0) - - s.logger.Infof("StartWorkflowExecution: response: %v \n", *we.RunId) - - // decider logic - workflowComplete := false - activityScheduled := false - activityData := int32(1) - var signalEvent *workflow.HistoryEvent - dtHandler := func(execution *workflow.WorkflowExecution, wt *workflow.WorkflowType, - previousStartedEventID, startedEventID int64, history *workflow.History) ([]byte, []*workflow.Decision, error) { - - if !activityScheduled { - activityScheduled = true - buf := new(bytes.Buffer) - s.Nil(binary.Write(buf, binary.LittleEndian, activityData)) - - return nil, []*workflow.Decision{{ - DecisionType: common.DecisionTypePtr(workflow.DecisionTypeScheduleActivityTask), - ScheduleActivityTaskDecisionAttributes: &workflow.ScheduleActivityTaskDecisionAttributes{ - ActivityId: common.StringPtr(strconv.Itoa(int(1))), - ActivityType: &workflow.ActivityType{Name: common.StringPtr(activityName)}, - TaskList: &workflow.TaskList{Name: &tl}, - Input: buf.Bytes(), - ScheduleToCloseTimeoutSeconds: common.Int32Ptr(100), - ScheduleToStartTimeoutSeconds: common.Int32Ptr(2), - StartToCloseTimeoutSeconds: common.Int32Ptr(50), - HeartbeatTimeoutSeconds: common.Int32Ptr(5), - }, - }}, nil - } else if previousStartedEventID > 0 { - for _, event := range history.Events[previousStartedEventID:] { - if *event.EventType == workflow.EventTypeWorkflowExecutionSignaled { - signalEvent = event - return nil, []*workflow.Decision{}, nil - } - } - } - - workflowComplete = true - return nil, []*workflow.Decision{{ - DecisionType: common.DecisionTypePtr(workflow.DecisionTypeCompleteWorkflowExecution), - CompleteWorkflowExecutionDecisionAttributes: &workflow.CompleteWorkflowExecutionDecisionAttributes{ - Result: []byte("Done."), - }, - }}, nil - } - - // activity handler - atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType, - activityID string, input []byte, taskToken []byte) ([]byte, bool, error) { - - return []byte("Activity Result."), false, nil - } - - queryHandler := func(task *workflow.PollForDecisionTaskResponse) ([]byte, error) { - s.NotNil(task.Query) - s.NotNil(task.Query.QueryType) - if *task.Query.QueryType == queryType { - return []byte("query-result"), nil - } - - return nil, errors.New("unknown-query-type") - } - - poller := &taskPoller{ - engine: s.engine, - domain: s.domainName, - taskList: taskList, - identity: identity, - decisionHandler: dtHandler, - activityHandler: atHandler, - queryHandler: queryHandler, - logger: s.logger, - suite: s, - sticktTaskList: stickyTaskList, - stickyScheduleToStartTimeoutSeconds: stickyScheduleToStartTimeoutSeconds, - } - - // Make first decision to schedule activity - _, err := poller.pollAndProcessDecisionTaskWithAttempt(false, false, false, true, int64(0)) - s.logger.Infof("pollAndProcessDecisionTask: %v", err) - s.Nil(err) - - // hehe, _ := s.engine.DescribeWorkflowExecution(createContext(), &workflow.DescribeWorkflowExecutionRequest{ - // Domain: common.StringPtr(s.domainName), - // Execution: &workflow.WorkflowExecution{ - // WorkflowId: common.StringPtr(id), - // RunId: common.StringPtr(*we.RunId), - // }, - // }) - // fmt.Println("*************") - // fmt.Println(hehe.ExecutionConfiguration.StickyTaskList) - // fmt.Println("*************") - - type QueryResult struct { - Resp *workflow.QueryWorkflowResponse - Err error - } - queryResultCh := make(chan QueryResult) - queryWorkflowFn := func(queryType string) { - queryResp, err := s.engine.QueryWorkflow(createContext(), &workflow.QueryWorkflowRequest{ - Domain: common.StringPtr(s.domainName), - Execution: &workflow.WorkflowExecution{ - WorkflowId: common.StringPtr(id), - RunId: common.StringPtr(*we.RunId), - }, - Query: &workflow.WorkflowQuery{ - QueryType: common.StringPtr(queryType), - }, - }) - queryResultCh <- QueryResult{Resp: queryResp, Err: err} - } - - // call QueryWorkflow in separate goroutinue (because it is blocking). That will generate a query task - go queryWorkflowFn(queryType) - // process that query task, which should respond via RespondQueryTaskCompleted - for { - // loop until process the query task - fmt.Println("looping s") - isQueryTask, errInner := poller.pollAndProcessDecisionTaskWithSticky(false, false) - s.logger.Infof("pollAndProcessDecisionTask: %v", err) - s.Nil(errInner) - fmt.Println("isQueryTask") - fmt.Println(isQueryTask) - fmt.Println("looping e") - if isQueryTask { - break - } - } - // wait until query result is ready - queryResult := <-queryResultCh - s.NoError(queryResult.Err) - s.NotNil(queryResult.Resp) - s.NotNil(queryResult.Resp.QueryResult) - queryResultString := string(queryResult.Resp.QueryResult) - s.Equal("query-result", queryResultString) - - go queryWorkflowFn("invalid-query-type") - for { - // loop until process the query task - isQueryTask, errInner := poller.pollAndProcessDecisionTaskWithSticky(false, false) - s.logger.Infof("pollAndProcessDecisionTask: %v", err) - s.Nil(errInner) - if isQueryTask { - break - } - } - queryResult = <-queryResultCh - s.NotNil(queryResult.Err) - queryFailError, ok := queryResult.Err.(*workflow.QueryFailedError) - s.True(ok) - s.Equal("unknown-query-type", queryFailError.Message) -} - -func (s *integrationSuite) TestQueryWorkflow_NonSticky() { +func (s *integrationSuite) TestQueryWorkflow() { id := "interation-query-workflow-test" wt := "interation-query-workflow-test-type" tl := "interation-query-workflow-test-tasklist" @@ -1832,7 +1658,7 @@ func (s *integrationSuite) TestQueryWorkflow_NonSticky() { } // Make first decision to schedule activity - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -1858,15 +1684,8 @@ func (s *integrationSuite) TestQueryWorkflow_NonSticky() { // call QueryWorkflow in separate goroutinue (because it is blocking). That will generate a query task go queryWorkflowFn(queryType) // process that query task, which should respond via RespondQueryTaskCompleted - for { - // loop until process the query task - isQueryTask, errInner := poller.pollAndProcessDecisionTask(false, false) - s.logger.Infof("pollAndProcessDecisionTask: %v", err) - s.Nil(errInner) - if isQueryTask { - break - } - } // wait until query result is ready + err = poller.pollAndProcessQueryTask(false, false) + // wait until query result is ready queryResult := <-queryResultCh s.NoError(queryResult.Err) s.NotNil(queryResult.Resp) @@ -1875,28 +1694,15 @@ func (s *integrationSuite) TestQueryWorkflow_NonSticky() { s.Equal("query-result", queryResultString) go queryWorkflowFn("invalid-query-type") - for { - // loop until process the query task - isQueryTask, errInner := poller.pollAndProcessDecisionTask(false, false) - s.logger.Infof("pollAndProcessDecisionTask: %v", err) - s.Nil(errInner) - if isQueryTask { - break - } - } + err = poller.pollAndProcessQueryTask(false, false) queryResult = <-queryResultCh s.NotNil(queryResult.Err) queryFailError, ok := queryResult.Err.(*workflow.QueryFailedError) s.True(ok) s.Equal("unknown-query-type", queryFailError.Message) - fmt.Println("$$$$$$$$$$$$$$$$$$$$$$$$$$") -} - -func (s *integrationSuite) TestDescribeWorkflowExecution_Sticky() { - // TODO } -func (s *integrationSuite) TestDescribeWorkflowExecution_NonSticky() { +func (s *integrationSuite) TestDescribeWorkflowExecution() { id := "interation-describe-wfe-test" wt := "interation-describe-wfe-test-type" tl := "interation-describe-wfe-test-tasklist" @@ -1989,7 +1795,7 @@ func (s *integrationSuite) TestDescribeWorkflowExecution_NonSticky() { } // first decision to schedule new activity - _, err = poller.pollAndProcessDecisionTask(false, false) + err = poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -2016,7 +1822,7 @@ func (s *integrationSuite) TestDescribeWorkflowExecution_NonSticky() { s.Equal(int64(7), *dweResponse.WorkflowExecutionInfo.HistoryLength) // Signaled, DecisionTaskScheduled // Process signal in decider - _, err = poller.pollAndProcessDecisionTask(true, false) + err = poller.pollAndProcessDecisionTask(true, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) s.NotNil(signalEvent) @@ -2099,14 +1905,13 @@ func (s *integrationSuite) TestContinueAsNewWorkflow() { } for i := 0; i < 10; i++ { - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err, strconv.Itoa(i)) } s.False(workflowComplete) - _, err := poller.pollAndProcessDecisionTask(true, false) - s.Nil(err) + s.Nil(poller.pollAndProcessDecisionTask(true, false)) s.True(workflowComplete) } @@ -2178,7 +1983,7 @@ func (s *integrationSuite) TestVisibility() { suite: s, } - _, err2 := poller.pollAndProcessDecisionTask(false, false) + err2 := poller.pollAndProcessDecisionTask(false, false) s.Nil(err2) startFilter := &workflow.StartTimeFilter{} @@ -2305,7 +2110,7 @@ func (s *integrationSuite) TestExternalRequestCancelWorkflowExecution() { suite: s, } - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -2332,7 +2137,7 @@ func (s *integrationSuite) TestExternalRequestCancelWorkflowExecution() { s.NotNil(err) s.IsType(&workflow.CancellationAlreadyRequestedError{}, err) - _, err = poller.pollAndProcessDecisionTask(true, false) + err = poller.pollAndProcessDecisionTask(true, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -2504,11 +2309,11 @@ func (s *integrationSuite) TestRequestCancelWorkflowDecisionExecution() { } // Start both current and foreign workflows to make some progress. - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) - _, err = foreignPoller.pollAndProcessDecisionTask(false, false) + err = foreignPoller.pollAndProcessDecisionTask(false, false) s.logger.Infof("foreign pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -2517,7 +2322,7 @@ func (s *integrationSuite) TestRequestCancelWorkflowDecisionExecution() { s.Nil(err) // Cancel the foreign workflow with this decision request. - _, err = poller.pollAndProcessDecisionTask(true, false) + err = poller.pollAndProcessDecisionTask(true, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -2555,7 +2360,7 @@ CheckHistoryLoopForCancelSent: s.True(cancellationSent) // Accept cancellation. - _, err = foreignPoller.pollAndProcessDecisionTask(false, false) + err = foreignPoller.pollAndProcessDecisionTask(false, false) s.logger.Infof("foreign pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -2682,12 +2487,12 @@ func (s *integrationSuite) TestRequestCancelWorkflowDecisionExecution_UnKnownTar } // Start both current and foreign workflows to make some progress. - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) // Cancel the foreign workflow with this decision request. - _, err = poller.pollAndProcessDecisionTask(true, false) + err = poller.pollAndProcessDecisionTask(true, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -2835,9 +2640,9 @@ func (s *integrationSuite) TestHistoryVersionCompatibilityCheck() { s.logger.Infof("Calling Decision Task: %d", i) var err error if decisionFailed { - _, err = poller.pollAndProcessDecisionTaskWithAttempt(false, false, false, false, int64(1)) + err = poller.pollAndProcessDecisionTaskWithAttempt(false, false, int64(1)) } else { - _, err = poller.pollAndProcessDecisionTask(false, false) + err = poller.pollAndProcessDecisionTask(false, false) } if i == testDecisionPollFailStep { @@ -2869,8 +2674,7 @@ func (s *integrationSuite) TestHistoryVersionCompatibilityCheck() { s.logger.Infof("Waiting for workflow to complete: RunId: %v", *we.RunId) s.False(workflowComplete) - _, err := poller.pollAndProcessDecisionTask(true, false) - s.Nil(err) + s.Nil(poller.pollAndProcessDecisionTask(true, false)) s.True(workflowComplete) } @@ -3002,23 +2806,25 @@ func (s *integrationSuite) TestChildWorkflowExecution() { } // Make first decision to start child execution - _, err := pollerParent.pollAndProcessDecisionTask(false, false) + err := pollerParent.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) s.True(childExecutionStarted) - // Process ChildExecution Started event and Process Child Execution and complete it - _, err = pollerParent.pollAndProcessDecisionTask(false, false) + // Process ChildExecution Started event + err = pollerParent.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) - _, err = pollerChild.pollAndProcessDecisionTask(false, false) + + // Process Child Execution and complete it + err = pollerChild.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) s.NotNil(startedEvent) s.True(childComplete) // Process ChildExecution completed event and complete parent execution - _, err = pollerParent.pollAndProcessDecisionTask(false, false) + err = pollerParent.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) s.NotNil(completedEvent) @@ -3170,14 +2976,14 @@ func (s *integrationSuite) TestChildWorkflowWithContinueAsNew() { } // Make first decision to start child execution - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) s.True(childExecutionStarted) // Process ChildExecution Started event and all generations of child executions for i := 0; i < 11; i++ { - _, err = poller.pollAndProcessDecisionTask(false, false) + err = poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) } @@ -3186,13 +2992,13 @@ func (s *integrationSuite) TestChildWorkflowWithContinueAsNew() { s.NotNil(startedEvent) // Process Child Execution final decision to complete it - _, err = poller.pollAndProcessDecisionTask(false, false) + err = poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) s.True(childComplete) // Process ChildExecution completed event and complete parent execution - _, err = poller.pollAndProcessDecisionTask(false, false) + err = poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) s.NotNil(completedEvent) @@ -3415,7 +3221,7 @@ func (s *integrationSuite) TestDecisionTaskFailed() { } // Make first decision to schedule activity - _, err := poller.pollAndProcessDecisionTask(false, false) + err := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) @@ -3426,7 +3232,7 @@ func (s *integrationSuite) TestDecisionTaskFailed() { // fail decision 5 times for i := 0; i < 5; i++ { - _, err := poller.pollAndProcessDecisionTaskWithAttempt(false, false, false, false, int64(i)) + err := poller.pollAndProcessDecisionTaskWithAttempt(false, false, int64(i)) s.Nil(err) } @@ -3434,7 +3240,7 @@ func (s *integrationSuite) TestDecisionTaskFailed() { s.Nil(err, "failed to send signal to execution") // process signal - _, err = poller.pollAndProcessDecisionTask(true, false) + err = poller.pollAndProcessDecisionTask(true, false) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) s.Equal(1, signalCount) @@ -3445,26 +3251,26 @@ func (s *integrationSuite) TestDecisionTaskFailed() { // fail decision 2 more times for i := 0; i < 2; i++ { - _, err := poller.pollAndProcessDecisionTaskWithAttempt(false, false, false, false, int64(i)) + err := poller.pollAndProcessDecisionTaskWithAttempt(false, false, int64(i)) s.Nil(err) } s.Equal(3, signalCount) // now send a signal during failed decision sendSignal = true - _, err = poller.pollAndProcessDecisionTaskWithAttempt(false, false, false, false, int64(2)) + err = poller.pollAndProcessDecisionTaskWithAttempt(false, false, int64(2)) s.Nil(err) s.Equal(4, signalCount) // fail decision 1 more times for i := 0; i < 2; i++ { - _, err := poller.pollAndProcessDecisionTaskWithAttempt(false, false, false, false, 3+int64(i)) + err := poller.pollAndProcessDecisionTaskWithAttempt(false, false, 3+int64(i)) s.Nil(err) } s.Equal(12, signalCount) // Make complete workflow decision - _, err = poller.pollAndProcessDecisionTaskWithAttempt(true, false, false, false, int64(5)) + err = poller.pollAndProcessDecisionTaskWithAttempt(true, false, int64(5)) s.logger.Infof("pollAndProcessDecisionTask: %v", err) s.Nil(err) s.True(workflowComplete) @@ -3596,7 +3402,7 @@ func (s *integrationSuite) TestGetWorkflowExecutionHistoryLongPoll() { // here do a long pull and check # of events and time elapsed // make first decision to schedule activity, this should affect the long poll above time.AfterFunc(time.Second*8, func() { - _, errDecision1 := poller.pollAndProcessDecisionTask(false, false) + errDecision1 := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", errDecision1) }) start = time.Now() @@ -3612,7 +3418,7 @@ func (s *integrationSuite) TestGetWorkflowExecutionHistoryLongPoll() { s.logger.Infof("pollAndProcessDecisionTask: %v", errActivity) }) time.AfterFunc(time.Second*8, func() { - _, errDecision2 := poller.pollAndProcessDecisionTask(false, false) + errDecision2 := poller.pollAndProcessDecisionTask(false, false) s.logger.Infof("pollAndProcessDecisionTask: %v", errDecision2) }) for token != nil { diff --git a/idl/github.com/uber/cadence/shared.thrift b/idl/github.com/uber/cadence/shared.thrift index cf8e53ec96e..1ad16428455 100644 --- a/idl/github.com/uber/cadence/shared.thrift +++ b/idl/github.com/uber/cadence/shared.thrift @@ -202,8 +202,6 @@ struct WorkflowExecutionConfiguration { 20: optional i32 executionStartToCloseTimeoutSeconds 30: optional i32 taskStartToCloseTimeoutSeconds 40: optional ChildPolicy childPolicy - 50: optional TaskList stickyTaskList - 60: optional i32 stickyScheduleToStartTimeoutSeconds } struct TransientDecisionInfo { diff --git a/service/frontend/handler.go b/service/frontend/handler.go index 79f0d185b55..c94e308180b 100644 --- a/service/frontend/handler.go +++ b/service/frontend/handler.go @@ -23,6 +23,7 @@ package frontend import ( "context" "encoding/json" + "errors" "sync" "github.com/pborman/uuid" @@ -389,11 +390,50 @@ func (wh *WorkflowHandler) PollForDecisionTask( return nil, nil } - resp, err := wh.createPollForDecisionTaskResponse(ctx, info.ID, matchingResp) - if err != nil { - return nil, wh.error(err, scope) + var history *gen.History + var persistenceToken []byte + var continuation []byte + if matchingResp.WorkflowExecution != nil { + // Non-empty response. Get the history + nextEventID := matchingResp.GetNextEventId() + firstEventID := common.FirstEventID + if matchingResp.GetStickyExecutionEnabled() { + firstEventID = matchingResp.GetPreviousStartedEventId() + 1 + } + history, persistenceToken, err = wh.getHistory( + info.ID, + *matchingResp.WorkflowExecution, + firstEventID, + nextEventID, + wh.config.DefaultHistoryMaxPageSize, + nil, + matchingResp.DecisionInfo) + if err != nil { + return nil, wh.error(err, scope) + } + + if matchingResp.WorkflowExecution.RunId == nil { + wh.Service.GetLogger().Errorf( + "PollForDecisionTask from matching engine doesn't have run id. TaskList: %v", + *pollRequest.TaskList.Name) + return nil, wh.error(errRunIDNotSet, scope) + } + + if len(persistenceToken) != 0 { + continuation, err = serializeHistoryToken(&getHistoryContinuationToken{ + RunID: *matchingResp.WorkflowExecution.RunId, + FirstEventID: firstEventID, + NextEventID: nextEventID, + PersistenceToken: persistenceToken, + TransientDecision: matchingResp.DecisionInfo, + }) + if err != nil { + return nil, wh.error(err, scope) + } + } } - return resp, nil + + return wh.createPollForDecisionTaskResponse(ctx, matchingResp, history, continuation), nil } func (wh *WorkflowHandler) cancelOutstandingPoll(ctx context.Context, err error, domainID string, taskListType int32, @@ -1348,26 +1388,30 @@ func (wh *WorkflowHandler) QueryWorkflow(ctx context.Context, DomainUUID: common.StringPtr(domainInfo.ID), QueryRequest: queryRequest, } - - // we should always use the mutable state, since it contains the sticky tasklist information - response, err := wh.history.DescribeWorkflowExecution( - ctx, - &h.DescribeWorkflowExecutionRequest{ + if queryRequest.Execution.RunId == nil { + // RunID is not set, we would use the running one if it exists. + response, err := wh.history.GetWorkflowExecutionNextEventID(ctx, &h.GetWorkflowExecutionNextEventIDRequest{ DomainUUID: common.StringPtr(domainInfo.ID), - Request: &gen.DescribeWorkflowExecutionRequest{ - Domain: queryRequest.Domain, - Execution: queryRequest.Execution, - }, + Execution: queryRequest.Execution, }) - if err != nil { - return nil, wh.error(err, scope) - } + if err != nil { + return nil, wh.error(err, scope) + } - queryRequest.Execution.RunId = response.WorkflowExecutionInfo.Execution.RunId - if response.ExecutionConfiguration.StickyTaskList == nil || len(response.ExecutionConfiguration.StickyTaskList.GetName()) == 0 { - matchingRequest.TaskList = response.ExecutionConfiguration.TaskList + queryRequest.Execution.RunId = response.RunId + matchingRequest.TaskList = response.Tasklist } else { - matchingRequest.TaskList = response.ExecutionConfiguration.StickyTaskList + // Get the TaskList from history (first event) + history, _, err := wh.getHistory(domainInfo.ID, *queryRequest.Execution, common.FirstEventID, common.FirstEventID+1, + 1, nil, nil) + if err != nil { + return nil, wh.error(err, scope) + } + if len(history.Events) == 0 || history.Events[0].GetEventType() != gen.EventTypeWorkflowExecutionStarted { + // this should not happen + return nil, wh.error(errors.New("invalid history events"), scope) + } + matchingRequest.TaskList = history.Events[0].WorkflowExecutionStartedEventAttributes.TaskList } matchingResp, err := wh.matching.QueryWorkflow(ctx, matchingRequest) @@ -1575,78 +1619,54 @@ func createDomainResponse(info *persistence.DomainInfo, config *persistence.Doma return i, c } -func (wh *WorkflowHandler) createPollForDecisionTaskResponse(ctx context.Context, domainID string, - matchingResp *m.PollForDecisionTaskResponse) (*gen.PollForDecisionTaskResponse, error) { - - if matchingResp.WorkflowExecution == nil { - // this will happen if there is no decision task to be send to worker / caller - return &gen.PollForDecisionTaskResponse{}, nil - } - - var history *gen.History - var continuation []byte - var err error - - if matchingResp.GetStickyExecutionEnabled() && matchingResp.Query != nil { - // meaning sticky query, we should not return any events to worker - // since query task only check the current status - history = &gen.History{ - Events: []*gen.HistoryEvent{}, - } - } else { - // here we have 3 cases: - // 1. sticky && non query task - // 2. non sticky && non query task - // 3. non sticky && query task - // for 1, partial history have to be send back - // for 2 and 3, full history have to be send back - - var persistenceToken []byte - - firstEventID := common.FirstEventID - nextEventID := matchingResp.GetNextEventId() - if matchingResp.GetStickyExecutionEnabled() { - firstEventID = matchingResp.GetPreviousStartedEventId() + 1 - } - history, persistenceToken, err = wh.getHistory( - domainID, - *matchingResp.WorkflowExecution, - firstEventID, - nextEventID, - wh.config.DefaultHistoryMaxPageSize, - nil, - matchingResp.DecisionInfo) - if err != nil { - return nil, err - } - - if len(persistenceToken) != 0 { - continuation, err = serializeHistoryToken(&getHistoryContinuationToken{ - RunID: *matchingResp.WorkflowExecution.RunId, - FirstEventID: firstEventID, - NextEventID: nextEventID, - PersistenceToken: persistenceToken, - TransientDecision: matchingResp.DecisionInfo, - }) - if err != nil { - return nil, err +func (wh *WorkflowHandler) createPollForDecisionTaskResponse(ctx context.Context, + matchingResponse *m.PollForDecisionTaskResponse, history *gen.History, nextPageToken []byte) *gen.PollForDecisionTaskResponse { + resp := &gen.PollForDecisionTaskResponse{} + if matchingResponse != nil { + resp.TaskToken = matchingResponse.TaskToken + resp.WorkflowExecution = matchingResponse.WorkflowExecution + resp.WorkflowType = matchingResponse.WorkflowType + resp.PreviousStartedEventId = matchingResponse.PreviousStartedEventId + resp.StartedEventId = matchingResponse.StartedEventId + resp.Query = matchingResponse.Query + resp.BacklogCountHint = matchingResponse.BacklogCountHint + } + + if matchingResponse.Query != nil && resp.WorkflowType == nil { + // for query task, the matching engine was not able to populate the WorkflowType, so set here from history + if history != nil && len(history.Events) > 0 && + history.Events[0].WorkflowExecutionStartedEventAttributes != nil { + resp.WorkflowType = history.Events[0].WorkflowExecutionStartedEventAttributes.WorkflowType + } else { + // this should never happen, but if it does happen, log it and respond error back to query client. + logging.LogQueryTaskMissingWorkflowTypeErrorEvent(wh.GetLogger(), + *matchingResponse.WorkflowExecution.WorkflowId, + *matchingResponse.WorkflowExecution.RunId, + *resp.Query.QueryType) + + queryTaskToken, err := wh.tokenSerializer.DeserializeQueryTaskToken(matchingResponse.TaskToken) + if err == nil { + completeType := gen.QueryTaskCompletedTypeFailed + wh.matching.RespondQueryTaskCompleted(ctx, &m.RespondQueryTaskCompletedRequest{ + DomainUUID: common.StringPtr(queryTaskToken.DomainID), + TaskList: &gen.TaskList{Name: common.StringPtr(queryTaskToken.TaskList)}, + TaskID: common.StringPtr(queryTaskToken.TaskID), + CompletedRequest: &gen.RespondQueryTaskCompletedRequest{ + TaskToken: matchingResponse.TaskToken, + CompletedType: &completeType, + ErrorMessage: common.StringPtr("server internal error: cannot get WorkflowType for QueryTask"), + }, + }) } - } - } - resp := &gen.PollForDecisionTaskResponse{ - TaskToken: matchingResp.TaskToken, - WorkflowExecution: matchingResp.WorkflowExecution, - WorkflowType: matchingResp.WorkflowType, - PreviousStartedEventId: matchingResp.PreviousStartedEventId, - StartedEventId: matchingResp.StartedEventId, - Query: matchingResp.Query, - BacklogCountHint: matchingResp.BacklogCountHint, - History: history, - NextPageToken: continuation, + // in this case, just return empty response for the pool request and client will just ignore + return &gen.PollForDecisionTaskResponse{} + } } - return resp, nil + resp.History = history + resp.NextPageToken = nextPageToken + return resp } func createGetWorkflowExecutionHistoryResponse( diff --git a/service/history/historyEngine.go b/service/history/historyEngine.go index 2cf9e612b24..cd6d847ddc6 100644 --- a/service/history/historyEngine.go +++ b/service/history/historyEngine.go @@ -402,8 +402,6 @@ func (e *historyEngineImpl) DescribeWorkflowExecution( ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(msBuilder.executionInfo.WorkflowTimeout), TaskStartToCloseTimeoutSeconds: common.Int32Ptr(msBuilder.executionInfo.DecisionTimeoutValue), ChildPolicy: common.ChildPolicyPtr(workflow.ChildPolicyTerminate), - StickyTaskList: &workflow.TaskList{Name: common.StringPtr(msBuilder.executionInfo.StickyTaskList)}, - StickyScheduleToStartTimeoutSeconds: common.Int32Ptr(msBuilder.executionInfo.StickyScheduleToStartTimeout), }, WorkflowExecutionInfo: &workflow.WorkflowExecutionInfo{ Execution: request.Request.Execution, @@ -1042,6 +1040,7 @@ Update_History_Loop: // Inform timer about the new ones. e.timerProcessor.NotifyNewTimer(timerTasks) + return err } diff --git a/service/matching/matchingEngine.go b/service/matching/matchingEngine.go index 5d51afb4d2e..f042b222cec 100644 --- a/service/matching/matchingEngine.go +++ b/service/matching/matchingEngine.go @@ -258,12 +258,9 @@ pollLoop: if tCtx.queryTaskInfo != nil { // for query task, we don't need to update history to record decision task started. but we need to know // the NextEventID so front end knows what are the history events to load for this decision task. - describeResp, err := e.historyService.DescribeWorkflowExecution(ctx, &h.DescribeWorkflowExecutionRequest{ + nextIDResp, err := e.historyService.GetWorkflowExecutionNextEventID(ctx, &h.GetWorkflowExecutionNextEventIDRequest{ DomainUUID: req.DomainUUID, - Request: &workflow.DescribeWorkflowExecutionRequest{ - Domain: req.PollRequest.Domain, - Execution: &tCtx.workflowExecution, - }, + Execution: &tCtx.workflowExecution, }) if err != nil { // will notify query client that the query task failed @@ -278,15 +275,9 @@ pollLoop: return emptyPollForDecisionTaskResponse, nil } - isStickyEnabled := false - if describeResp.ExecutionConfiguration.StickyTaskList != nil && len(describeResp.ExecutionConfiguration.StickyTaskList.GetName()) != 0 { - isStickyEnabled = true - } resp := &h.RecordDecisionTaskStartedResponse{ - PreviousStartedEventId: describeResp.WorkflowExecutionInfo.HistoryLength, - NextEventId: describeResp.WorkflowExecutionInfo.HistoryLength, - WorkflowType: describeResp.WorkflowExecutionInfo.Type, - StickyExecutionEnabled: common.BoolPtr(isStickyEnabled), + PreviousStartedEventId: nextIDResp.EventId, + NextEventId: nextIDResp.EventId, } tCtx.completeTask(nil) return e.createPollForDecisionTaskResponse(tCtx, resp), nil @@ -492,11 +483,11 @@ func (e *matchingEngineImpl) createPollForDecisionTaskResponse(context *taskCont ScheduleAttempt: historyResponse.GetAttempt(), } response.TaskToken, _ = e.tokenSerializer.Serialize(token) + response.WorkflowType = historyResponse.WorkflowType } if historyResponse.GetPreviousStartedEventId() != common.EmptyEventID { response.PreviousStartedEventId = historyResponse.PreviousStartedEventId } - response.WorkflowType = historyResponse.WorkflowType response.StartedEventId = historyResponse.StartedEventId response.StickyExecutionEnabled = historyResponse.StickyExecutionEnabled response.BacklogCountHint = common.Int64Ptr(context.backlogCountHint)