Skip to content

Commit

Permalink
remove startedEventId from PollForActivityTaskResponse (cadence-workf…
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminc authored Oct 26, 2017
1 parent d79841b commit 6a59d1b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .gen/go/shared/idl.go

Large diffs are not rendered by default.

36 changes: 2 additions & 34 deletions .gen/go/shared/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions host/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type (
decisionTaskHandler func(execution *workflow.WorkflowExecution, wt *workflow.WorkflowType,
previousStartedEventID, startedEventID int64, history *workflow.History) ([]byte, []*workflow.Decision)
activityTaskHandler func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, takeToken []byte) ([]byte, bool, error)
activityID string, input []byte, takeToken []byte) ([]byte, bool, error)

queryHandler func(task *workflow.PollForDecisionTaskResponse) ([]byte, error)

Expand Down Expand Up @@ -270,7 +270,7 @@ func (s *integrationSuite) TestTerminateWorkflow() {
}

atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {

return []byte("Activity Result."), false, nil
}
Expand Down Expand Up @@ -431,7 +431,7 @@ func (s *integrationSuite) TestSequentialWorkflow() {

expectedActivity := int32(1)
atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {
s.Equal(id, *execution.WorkflowId)
s.Equal(activityName, *activityType.Name)
id, _ := strconv.Atoi(activityID)
Expand Down Expand Up @@ -648,7 +648,7 @@ retry:
p.logger.Debugf("Received Activity task: %v", response)

result, cancel, err2 := p.activityHandler(response.WorkflowExecution, response.ActivityType, *response.ActivityId,
*response.StartedEventId, response.Input, response.TaskToken)
response.Input, response.TaskToken)
if cancel {
p.logger.Info("Executing RespondActivityTaskCanceled")
return p.engine.RespondActivityTaskCanceled(createContext(), &workflow.RespondActivityTaskCanceledRequest{
Expand Down Expand Up @@ -744,7 +744,7 @@ func (s *integrationSuite) TestDecisionAndActivityTimeoutsWorkflow() {
}

atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {
s.Equal(id, *execution.WorkflowId)
s.Equal(activityName, *activityType.Name)
s.logger.Infof("Activity ID: %v", activityID)
Expand Down Expand Up @@ -849,7 +849,7 @@ func (s *integrationSuite) TestActivityHeartBeatWorkflow_Success() {

activityExecutedCount := 0
atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {
s.Equal(id, *execution.WorkflowId)
s.Equal(activityName, *activityType.Name)
for i := 0; i < 10; i++ {
Expand Down Expand Up @@ -957,7 +957,7 @@ func (s *integrationSuite) TestActivityHeartBeatWorkflow_Timeout() {

activityExecutedCount := 0
atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {
s.Equal(id, *execution.WorkflowId)
s.Equal(activityName, *activityType.Name)
// Timing out more than HB time.
Expand Down Expand Up @@ -1142,7 +1142,7 @@ func (s *integrationSuite) TestActivityCancelation() {

activityExecutedCount := 0
atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {
s.Equal(id, *execution.WorkflowId)
s.Equal(activityName, *activityType.Name)
for i := 0; i < 10; i++ {
Expand Down Expand Up @@ -1282,7 +1282,7 @@ func (s *integrationSuite) TestSignalWorkflow() {

// activity handler
atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {

return []byte("Activity Result."), false, nil
}
Expand Down Expand Up @@ -1577,7 +1577,7 @@ func (s *integrationSuite) TestQueryWorkflow() {

// activity handler
atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {

return []byte("Activity Result."), false, nil
}
Expand Down Expand Up @@ -1907,7 +1907,7 @@ func (s *integrationSuite) TestExternalRequestCancelWorkflowExecution() {
}

atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {
return []byte("Activity Result."), false, nil
}

Expand Down Expand Up @@ -2059,7 +2059,7 @@ func (s *integrationSuite) TestRequestCancelWorkflowDecisionExecution() {
}

atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {
return []byte("Activity Result."), false, nil
}

Expand Down Expand Up @@ -2280,7 +2280,7 @@ func (s *integrationSuite) TestRequestCancelWorkflowDecisionExecution_UnKnownTar
}

atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {
return []byte("Activity Result."), false, nil
}

Expand Down Expand Up @@ -2415,7 +2415,7 @@ func (s *integrationSuite) TestHistoryVersionCompatibilityCheck() {
}

atHandler := func(execution *workflow.WorkflowExecution, activityType *workflow.ActivityType,
activityID string, startedEventID int64, input []byte, taskToken []byte) ([]byte, bool, error) {
activityID string, input []byte, taskToken []byte) ([]byte, bool, error) {
s.Equal(id, *execution.WorkflowId)
s.Equal(activityName, *activityType.Name)
s.logger.Infof("Activity ID: %v", activityID)
Expand Down
1 change: 0 additions & 1 deletion idl/github.com/uber/cadence/shared.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,6 @@ struct PollForActivityTaskResponse {
30: optional string activityId
40: optional ActivityType activityType
50: optional binary input
60: optional i64 (js.type = "Long") startedEventId
70: optional i64 (js.type = "Long") scheduledTimestamp
80: optional i32 scheduleToCloseTimeoutSeconds
90: optional i64 (js.type = "Long") startedTimestamp
Expand Down
1 change: 0 additions & 1 deletion service/matching/matchingEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ func (e *matchingEngineImpl) createPollForActivityTaskResponse(context *taskCont
response.ActivityId = attributes.ActivityId
response.ActivityType = attributes.ActivityType
response.Input = attributes.Input
response.StartedEventId = common.Int64Ptr(*startedEvent.EventId)
response.WorkflowExecution = workflowExecutionPtr(context.workflowExecution)
response.ScheduledTimestamp = common.Int64Ptr(*scheduledEvent.Timestamp)
response.ScheduleToCloseTimeoutSeconds = common.Int32Ptr(*attributes.ScheduleToCloseTimeoutSeconds)
Expand Down
4 changes: 0 additions & 4 deletions service/matching/matchingEngine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ func (s *matchingEngineSuite) TestAddThenConsumeActivities() {
s.EqualValues(activityID, *result.ActivityId)
s.EqualValues(activityType, result.ActivityType)
s.EqualValues(activityInput, result.Input)
s.EqualValues(startedID, *result.StartedEventId)
s.EqualValues(workflowExecution, *result.WorkflowExecution)
s.Equal(true, validateTimeRange(time.Unix(0, *result.ScheduledTimestamp), time.Minute))
s.Equal(int32(100), *result.ScheduleToCloseTimeoutSeconds)
Expand Down Expand Up @@ -526,7 +525,6 @@ func (s *matchingEngineSuite) TestSyncMatchActivities() {
s.EqualValues(activityID, *result.ActivityId)
s.EqualValues(activityType, result.ActivityType)
s.EqualValues(activityInput, result.Input)
s.EqualValues(startedID, *result.StartedEventId)
s.EqualValues(workflowExecution, *result.WorkflowExecution)
token := &common.TaskToken{
DomainID: domainID,
Expand Down Expand Up @@ -646,7 +644,6 @@ func (s *matchingEngineSuite) TestConcurrentPublishConsumeActivities() {
s.EqualValues(activityID, *result.ActivityId)
s.EqualValues(activityType, result.ActivityType)
s.EqualValues(activityInput, result.Input)
s.EqualValues(startedID, *result.StartedEventId)
s.EqualValues(workflowExecution, *result.WorkflowExecution)
token := &common.TaskToken{
DomainID: domainID,
Expand Down Expand Up @@ -944,7 +941,6 @@ func (s *matchingEngineSuite) TestMultipleEnginesActivitiesRangeStealing() {
s.EqualValues(activityID, *result.ActivityId)
s.EqualValues(activityType, result.ActivityType)
s.EqualValues(activityInput, result.Input)
s.EqualValues(startedID, *result.StartedEventId)
s.EqualValues(workflowExecution, *result.WorkflowExecution)
token := &common.TaskToken{
DomainID: domainID,
Expand Down

0 comments on commit 6a59d1b

Please sign in to comment.