Skip to content

Commit

Permalink
Convert Control field to string (#110)
Browse files Browse the repository at this point in the history
* Convert Control field to string.

* Update go.temporal.io/temporal-proto.
  • Loading branch information
alexshtin committed Apr 28, 2020
1 parent 69dea86 commit e369525
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/uber-go/tally v3.3.15+incompatible
github.com/uber/jaeger-client-go v2.22.1+incompatible
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
go.temporal.io/temporal-proto v0.20.26
go.temporal.io/temporal-proto v0.20.27
go.uber.org/atomic v1.6.0
go.uber.org/goleak v1.0.0
go.uber.org/zap v1.14.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMW
github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=
github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.temporal.io/temporal-proto v0.20.26 h1:EkAJ3nlpwk7WCjTenWMvsGClB5yReffTh20MVgb2vgs=
go.temporal.io/temporal-proto v0.20.26/go.mod h1:Lv8L8YBpbp0Z7V5nbvw5UD0j7x0isebhCOIDLkBqn6s=
go.temporal.io/temporal-proto v0.20.27 h1:g/UMo4TZyUGCGCAsvz81IIlkN6YQW7S5Ua4bwpjECvQ=
go.temporal.io/temporal-proto v0.20.27/go.mod h1:Lv8L8YBpbp0Z7V5nbvw5UD0j7x0isebhCOIDLkBqn6s=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/goleak v1.0.0 h1:qsup4IcBdlmsnGfqyLl4Ntn3C2XCCuKAE7DwHpScyUo=
Expand Down
4 changes: 2 additions & 2 deletions internal/internal_decision_state_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ func (h *decisionsHelper) requestCancelExternalWorkflowExecution(namespace, work
Namespace: namespace,
WorkflowId: workflowID,
RunId: runID,
Control: []byte(cancellationID),
Control: cancellationID,
ChildWorkflowOnly: false,
}
decision := h.newCancelExternalWorkflowStateMachine(attributes, cancellationID)
Expand Down Expand Up @@ -943,7 +943,7 @@ func (h *decisionsHelper) signalExternalWorkflowExecution(namespace, workflowID,
},
SignalName: signalName,
Input: input,
Control: []byte(signalID),
Control: signalID,
ChildWorkflowOnly: childWorkflowOnly,
}
decision := h.newSignalExternalWorkflowStateMachine(attributes, signalID)
Expand Down
4 changes: 2 additions & 2 deletions internal/internal_decision_state_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ func Test_CancelExternalWorkflowStateMachine_Succeed(t *testing.T) {
Namespace: namespace,
WorkflowId: workflowID,
RunId: runID,
Control: []byte(cancellationID),
Control: cancellationID,
ChildWorkflowOnly: false,
},
decisions[0].GetRequestCancelExternalWorkflowExecutionDecisionAttributes(),
Expand Down Expand Up @@ -603,7 +603,7 @@ func Test_CancelExternalWorkflowStateMachine_Failed(t *testing.T) {
Namespace: namespace,
WorkflowId: workflowID,
RunId: runID,
Control: []byte(cancellationID),
Control: cancellationID,
ChildWorkflowOnly: false,
},
decisions[0].GetRequestCancelExternalWorkflowExecutionDecisionAttributes(),
Expand Down
4 changes: 2 additions & 2 deletions internal/internal_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ func (aw *WorkflowReplayer) replayWorkflowHistory(logger *zap.Logger, service wo
if last.GetEventType() != eventpb.EventType_WorkflowExecutionCompleted && last.GetEventType() != eventpb.EventType_WorkflowExecutionContinuedAsNew {
return nil
}
err = fmt.Errorf("replay workflow doesn't return the same result as the last event, resp: %v, last: %v", resp, last)

if resp != nil {
completeReq, ok := resp.(*workflowservice.RespondDecisionTaskCompletedRequest)
if ok {
Expand All @@ -1275,7 +1275,7 @@ func (aw *WorkflowReplayer) replayWorkflowHistory(logger *zap.Logger, service wo
}
}
}
return err
return fmt.Errorf("replay workflow doesn't return the same result as the last event, resp: %v, last: %v", resp, last)
}

func extractHistoryFromFile(jsonfileName string, lastEventID int64) (*eventpb.History, error) {
Expand Down
4 changes: 2 additions & 2 deletions internal/testdata/parentWF.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
},
"signalName": "test-signal",
"input": null,
"control": "MA==",
"control": "0",
"childWorkflowOnly": true
}
},
Expand All @@ -175,7 +175,7 @@
"workflowId": "child_workflow:0ea65eda-a0db-4a59-bef3-dce48e8484f8",
"runId": ""
},
"control": "MA=="
"control": "0"
}
},
{
Expand Down

0 comments on commit e369525

Please sign in to comment.