Skip to content

Commit

Permalink
Some documentation fixes (#1004)
Browse files Browse the repository at this point in the history
* Fix ScheduleListEntry docs for number of actions

* Enforce MaxConcurrentWorkflowTaskExecutionSize is greater than 1

Setting to one will cause the worker to not process workflow tasks
  • Loading branch information
Quinn-With-Two-Ns authored Jan 16, 2023
1 parent a080d2c commit 002db6e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions internal/internal_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,14 @@ func NewAggregatedWorker(client *WorkflowClient, taskQueue string, options Worke
panic("cannot set MaxConcurrentWorkflowTaskPollers to 1")
}

// If max-concurrent workflow task execution size is 1, the worker will only do
// sticky-queue requests and never regular-queue requests. This is because we
// limit the number of running pollers to MaxConcurrentWorkflowTaskExecutionSize.
// We disallow the value of 1 here.
if options.MaxConcurrentWorkflowTaskExecutionSize == 1 {
panic("cannot set MaxConcurrentWorkflowTaskExecutionSize to 1")
}

// Need reference to result for fatal error handler
var aw *AggregatedWorker
fatalErrorCallback := func(err error) {
Expand Down
4 changes: 2 additions & 2 deletions internal/schedule_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,12 @@ type (
// describes what workflow is run.
WorkflowType WorkflowType

// RecentActions- Most recent 10 Actions started (including manual triggers).
// RecentActions- Most recent 5 Actions started (including manual triggers).
//
// Sorted from older start time to newer.
RecentActions []ScheduleActionResult

// NextActionTimes - Next 10 scheduled Action times.
// NextActionTimes - Next 5 scheduled Action times.
NextActionTimes []time.Time

// Memo - Non-indexed user supplied information.
Expand Down
4 changes: 3 additions & 1 deletion internal/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ type (
MaxConcurrentActivityTaskPollers int

// Optional: To set the maximum concurrent workflow task executions this worker can have.
// The zero value of this uses the default value.
// The zero value of this uses the default value. Due to internal logic where pollers
// alternate between stick and non-sticky queues, this
// value cannot be 1 and will panic if set to that value.
// default: defaultMaxConcurrentTaskExecutionSize(1k)
MaxConcurrentWorkflowTaskExecutionSize int

Expand Down

0 comments on commit 002db6e

Please sign in to comment.