Skip to content

Commit e66e2d4

Browse files
authored
Add JitterStart support to client (#1178)
* Add JitterStart support to client * Dummy commit to see if it unblocks buildkite...
1 parent 08bc387 commit e66e2d4

File tree

14 files changed

+356
-15
lines changed

14 files changed

+356
-15
lines changed

.gen/go/shared/shared.go

Lines changed: 326 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ We'd love your help in making the Cadence Go client great. Please review our [co
2828

2929
## License
3030
MIT License, please see [LICENSE](LICENSE) for details.
31-
31+

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/stretchr/testify v1.4.0
1717
github.com/twmb/murmur3 v1.1.6 // indirect
1818
github.com/uber-go/tally/v4 v4.1.1
19-
github.com/uber/cadence-idl v0.0.0-20220223020740-f2f5b7fc2bbd
19+
github.com/uber/cadence-idl v0.0.0-20220713235846-fda89e95df1e
2020
github.com/uber/jaeger-client-go v2.22.1+incompatible
2121
github.com/uber/tchannel-go v1.16.0
2222
go.uber.org/atomic v1.9.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ github.com/uber-go/tally v3.3.15+incompatible h1:9hLSgNBP28CjIaDmAuRTq9qV+UZY+9P
194194
github.com/uber-go/tally v3.3.15+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyufu1cEi0jdVnRdxvjnmU=
195195
github.com/uber-go/tally/v4 v4.1.1 h1:jhy6WOZp4nHyCqeV43x3Wz370LXUGBhgW2JmzOIHCWI=
196196
github.com/uber-go/tally/v4 v4.1.1/go.mod h1:aXeSTDMl4tNosyf6rdU8jlgScHyjEGGtfJ/uwCIf/vM=
197-
github.com/uber/cadence-idl v0.0.0-20220223020740-f2f5b7fc2bbd h1:KGLWWhlM4I1++coccaIqGJyC4x8Lyof+42lPZP05aaI=
198-
github.com/uber/cadence-idl v0.0.0-20220223020740-f2f5b7fc2bbd/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
197+
github.com/uber/cadence-idl v0.0.0-20220713235846-fda89e95df1e h1:N5yzwaoEzjQ7YlXU0UDJeOBrTt/EGLsrqmtu1YSbvdk=
198+
github.com/uber/cadence-idl v0.0.0-20220713235846-fda89e95df1e/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
199199
github.com/uber/jaeger-client-go v2.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM=
200200
github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
201201
github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=

idls

Submodule idls updated from f2f5b7f to fda89e9

internal/client.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ type (
413413
// The resolution is seconds.
414414
// Optional: defaulted to 0 seconds
415415
DelayStart time.Duration
416+
417+
// JitterStart - Seconds to jitter the workflow start. For example, if set to 10, the workflow will start some time between 0-10 seconds.
418+
// This works with CronSchedule and with DelayStart.
419+
// Optional: defaulted to 0 seconds
420+
JitterStart time.Duration
416421
}
417422

418423
// RetryPolicy defines the retry policy.

internal/compatibility/proto/decision.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ func Decision(d *shared.Decision) *apiv1.Decision {
140140
Header: Header(attr.Header),
141141
Memo: Memo(attr.Memo),
142142
SearchAttributes: SearchAttributes(attr.SearchAttributes),
143+
JitterStart: secondsToDuration(attr.JitterStartSeconds),
143144
},
144145
}
145146
case shared.DecisionTypeStartChildWorkflowExecution:

internal/compatibility/proto/history.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ func StartChildWorkflowExecutionInitiatedEventAttributes(t *shared.StartChildWor
540540
Memo: Memo(t.Memo),
541541
SearchAttributes: SearchAttributes(t.SearchAttributes),
542542
DelayStart: secondsToDuration(t.DelayStartSeconds),
543+
JitterStart: secondsToDuration(t.JitterStartSeconds),
543544
}
544545
}
545546

internal/compatibility/proto/request.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ func SignalWithStartWorkflowExecutionRequest(t *shared.SignalWithStartWorkflowEx
408408
SearchAttributes: SearchAttributes(t.SearchAttributes),
409409
Header: Header(t.Header),
410410
DelayStart: secondsToDuration(t.DelayStartSeconds),
411+
JitterStart: secondsToDuration(t.JitterStartSeconds),
411412
},
412413
SignalName: t.GetSignalName(),
413414
SignalInput: Payload(t.SignalInput),
@@ -451,6 +452,7 @@ func StartWorkflowExecutionRequest(t *shared.StartWorkflowExecutionRequest) *api
451452
SearchAttributes: SearchAttributes(t.SearchAttributes),
452453
Header: Header(t.Header),
453454
DelayStart: secondsToDuration(t.DelayStartSeconds),
455+
JitterStart: secondsToDuration(t.JitterStartSeconds),
454456
}
455457
}
456458

internal/compatibility/testdata/decision.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ var (
105105
Header: &Header,
106106
Memo: &Memo,
107107
SearchAttributes: &SearchAttributes,
108+
JitterStart: Duration4,
108109
}
109110
FailWorkflowExecutionDecisionAttributes = apiv1.FailWorkflowExecutionDecisionAttributes{
110111
Failure: &Failure,

0 commit comments

Comments
 (0)