Skip to content

Commit

Permalink
fix SyncFlow getting stuck waiting for source connector (#1504)
Browse files Browse the repository at this point in the history
Would cause activity to run on different worker, causing it to get stuck
waiting for source connector
  • Loading branch information
serprex authored Mar 19, 2024
1 parent 2399689 commit 966e4a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flow/workflows/sync_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ func SyncFlowWorkflow(
})
var fMaintain workflow.Future
var sessionID string
syncSessionCtx := ctx
if enableOneSync {
sessionOptions := &workflow.SessionOptions{
CreationTimeout: 5 * time.Minute,
ExecutionTimeout: 144 * time.Hour,
HeartbeatTimeout: time.Minute,
}
syncSessionCtx, err := workflow.CreateSession(ctx, sessionOptions)
var err error
syncSessionCtx, err = workflow.CreateSession(ctx, sessionOptions)
if err != nil {
return err
}
Expand Down Expand Up @@ -103,7 +105,7 @@ func SyncFlowWorkflow(
currentSyncFlowNum += 1
logger.Info("executing sync flow", slog.Int("count", currentSyncFlowNum))

syncFlowCtx := workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
syncFlowCtx := workflow.WithActivityOptions(syncSessionCtx, workflow.ActivityOptions{
StartToCloseTimeout: 72 * time.Hour,
HeartbeatTimeout: time.Minute,
WaitForCancellation: true,
Expand Down

0 comments on commit 966e4a5

Please sign in to comment.