Skip to content

Commit

Permalink
Register system workflow activities with default worker (#5017)
Browse files Browse the repository at this point in the history
<!-- Describe what has changed in this PR -->
**What changed?**
Registering system workflow activities with the default worker.

<!-- Tell your future self why have you made these changes -->
**Why?**
This is to prevent running workflows from getting stuck when upgrading
to 1.23 and will be removed in 1.24.

<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
**How did you test it?**
Existing tests

<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
**Potential risks**
None

<!-- Is this PR a hotfix candidate or require that a notification be
sent to the broader community? (Yes/No) -->
**Is hotfix candidate?**
No
  • Loading branch information
pdoerner committed Oct 23, 2023
1 parent aa42426 commit 24557b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions service/worker/migration/fx.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ func (wc *replicationWorkerComponent) RegisterWorkflow(registry sdkworker.Regist
registry.RegisterWorkflowWithOptions(ForceReplicationWorkflow, workflow.RegisterOptions{Name: forceReplicationWorkflowName})
registry.RegisterWorkflowWithOptions(NamespaceHandoverWorkflow, workflow.RegisterOptions{Name: namespaceHandoverWorkflowName})
registry.RegisterWorkflow(ForceTaskQueueUserDataReplicationWorkflow)

registry.RegisterActivity(wc.activities().GetMetadata) // may be run locally
}

func (wc *replicationWorkerComponent) DedicatedWorkflowWorkerOptions() *workercommon.DedicatedWorkerOptions {
Expand Down
3 changes: 3 additions & 0 deletions service/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ func (wm *workerManager) Start() {
// use default worker
wc.RegisterActivities(defaultWorker)
} else {
// TODO: This is to prevent issues during upgrade/downgrade. Remove in 1.24 release.
wc.RegisterActivities(defaultWorker)

// this worker component requires a dedicated worker for activities
activityWorkerOptions.Options.DisableWorkflowWorker = true
activityWorker := wm.sdkClientFactory.NewWorker(sdkClient, activityWorkerOptions.TaskQueue, activityWorkerOptions.Options)
Expand Down

0 comments on commit 24557b3

Please sign in to comment.