Skip to content

Commit d0152f8

Browse files
committed
fix: Verify all samples run end-to-end and fix heartbeat timeout bug
Ran all 7 samples against Cadence server to verify they work: - greetings, timer, branch, choice, pickfirst, activities, operations Discovered bug: Activities without heartbeating were failing with ActivityTaskTimedOut (HEARTBEAT) because HeartbeatTimeout was set but the activities never called activity.RecordHeartbeat(). Fix: Removed HeartbeatTimeout from simple activities (greetings, branch, choice) that complete quickly and don't need heartbeating. Signed-off-by: Diana Zawadzki <[email protected]>
1 parent 398fcb1 commit d0152f8

File tree

3 files changed

+0
-4
lines changed

3 files changed

+0
-4
lines changed

new_samples/branch/branch_workflow.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ func BranchWorkflow(ctx workflow.Context) error {
1717
ao := workflow.ActivityOptions{
1818
ScheduleToStartTimeout: time.Minute,
1919
StartToCloseTimeout: time.Minute,
20-
HeartbeatTimeout: time.Second * 20,
2120
}
2221
ctx = workflow.WithActivityOptions(ctx, ao)
2322

@@ -52,7 +51,6 @@ func ParallelWorkflow(ctx workflow.Context) error {
5251
ao := workflow.ActivityOptions{
5352
ScheduleToStartTimeout: time.Minute,
5453
StartToCloseTimeout: time.Minute,
55-
HeartbeatTimeout: time.Second * 20,
5654
}
5755
ctx = workflow.WithActivityOptions(ctx, ao)
5856

new_samples/choice/choice_workflow.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ func ChoiceWorkflow(ctx workflow.Context) error {
2424
ao := workflow.ActivityOptions{
2525
ScheduleToStartTimeout: time.Minute,
2626
StartToCloseTimeout: time.Minute,
27-
HeartbeatTimeout: time.Second * 20,
2827
}
2928
ctx = workflow.WithActivityOptions(ctx, ao)
3029

new_samples/greetings/greetings_workflow.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ func GreetingsWorkflow(ctx workflow.Context) error {
1414
ao := workflow.ActivityOptions{
1515
ScheduleToStartTimeout: time.Minute,
1616
StartToCloseTimeout: time.Minute,
17-
HeartbeatTimeout: time.Second * 20,
1817
}
1918
ctx = workflow.WithActivityOptions(ctx, ao)
2019

0 commit comments

Comments
 (0)