Skip to content

Commit 588d4a6

Browse files
authored
core/services/workflows: restore and reconfigure Workflow[ExecutionConcurrency]Limits (#21779)
1 parent 9ace599 commit 588d4a6

17 files changed

Lines changed: 41 additions & 26 deletions

File tree

core/scripts/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ require (
4545
github.com/smartcontractkit/chain-selectors v1.0.97
4646
github.com/smartcontractkit/chainlink-automation v0.8.1
4747
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260317185256-d5f7db87ae70
48-
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260327152052-032e58514a84
48+
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260331163339-a3c0d217e843
4949
github.com/smartcontractkit/chainlink-common/keystore v1.0.2
5050
github.com/smartcontractkit/chainlink-data-streams v0.1.13
5151
github.com/smartcontractkit/chainlink-deployments-framework v0.86.3

core/scripts/go.sum

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

core/services/workflows/syncerlimiter/limiter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func NewWorkflowLimits(lggr logger.Logger, cfg Config, lf limits.Factory) (limit
4949
lggr = logger.Named(lggr, "WorkflowExecutionLimiter")
5050
cfg.PerOwnerOverrides = normalizeOverrides(cfg.PerOwnerOverrides)
5151

52-
ownerLimit := cresettings.Default.PerOwner.WorkflowExecutionConcurrencyLimit // make a copy
52+
ownerLimit := cresettings.Default.PerOwner.WorkflowLimit // make a copy
5353
if cfg.PerOwner > 0 {
5454
ownerLimit.DefaultValue = int(cfg.PerOwner)
5555
}
@@ -63,7 +63,7 @@ func NewWorkflowLimits(lggr logger.Logger, cfg Config, lf limits.Factory) (limit
6363
return nil, fmt.Errorf("failed to create owner resource limiter: %w", err)
6464
}
6565

66-
globalLimit := cresettings.Default.WorkflowExecutionConcurrencyLimit // make a copy
66+
globalLimit := cresettings.Default.WorkflowLimit // make a copy
6767
if cfg.Global > 0 {
6868
globalLimit.DefaultValue = int(cfg.Global)
6969
}

core/services/workflows/v2/config.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,25 @@ func (l *EngineLimiters) init(lf limits.Factory, cfgFn func(*cresettings.Workflo
137137
if err != nil {
138138
return
139139
}
140-
l.ExecutionConcurrency, err = limits.MakeResourcePoolLimiter(lf, cfg.ExecutionConcurrencyLimit)
140+
141+
globalExec, err := limits.MakeResourcePoolLimiter(lf, cresettings.Default.WorkflowExecutionConcurrencyLimit)
142+
if err != nil {
143+
return
144+
}
145+
orgExec, err := limits.MakeResourcePoolLimiter(lf, cresettings.Default.PerOrg.WorkflowExecutionConcurrencyLimit)
141146
if err != nil {
142147
return
143148
}
149+
ownerExec, err := limits.MakeResourcePoolLimiter(lf, cresettings.Default.PerOwner.WorkflowExecutionConcurrencyLimit)
150+
if err != nil {
151+
return
152+
}
153+
wfExec, err := limits.MakeResourcePoolLimiter(lf, cfg.ExecutionConcurrencyLimit)
154+
if err != nil {
155+
return
156+
}
157+
l.ExecutionConcurrency = limits.MultiResourcePoolLimiter[int]{wfExec, ownerExec, orgExec, globalExec}
158+
144159
l.WASMBinarySize, err = limits.MakeUpperBoundLimiter(lf, cfg.WASMBinarySizeLimit)
145160
if err != nil {
146161
return

core/services/workflows/v2/engine_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ func TestEngine_Start_RateLimited(t *testing.T) {
100100
t.Parallel()
101101
getter, err := settings.NewTOMLGetter([]byte(`
102102
[global]
103-
WorkflowExecutionConcurrencyLimit = "2"
103+
WorkflowLimit = "2"
104104
[global.PerOwner]
105-
WorkflowExecutionConcurrencyLimit = "1"
105+
WorkflowLimit = "1"
106106
`))
107107
require.NoError(t, err)
108108
sLimiter, err := syncerlimiter.NewWorkflowLimits(logger.Test(t), syncerlimiter.Config{

deployment/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ require (
4444
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260224214816-cb23ec38649f
4545
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260310183131-8d0f0e383288
4646
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260317175207-e9ff89561326
47-
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260327152052-032e58514a84
47+
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260331163339-a3c0d217e843
4848
github.com/smartcontractkit/chainlink-common/keystore v1.0.2
4949
github.com/smartcontractkit/chainlink-deployments-framework v0.86.3
5050
github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260330133421-5151ea0c3b05

deployment/go.sum

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

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ require (
8585
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260224214816-cb23ec38649f
8686
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5
8787
github.com/smartcontractkit/chainlink-ccv v0.0.0-20260324000441-d4cfddc9f7d2
88-
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260327152052-032e58514a84
88+
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260331163339-a3c0d217e843
8989
github.com/smartcontractkit/chainlink-common/keystore v1.0.2
9090
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10
9191
github.com/smartcontractkit/chainlink-data-streams v0.1.13

go.sum

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

integration-tests/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ require (
3838
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260317185256-d5f7db87ae70
3939
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260310183131-8d0f0e383288
4040
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260310183131-8d0f0e383288
41-
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260327152052-032e58514a84
41+
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260331163339-a3c0d217e843
4242
github.com/smartcontractkit/chainlink-common/keystore v1.0.2
4343
github.com/smartcontractkit/chainlink-deployments-framework v0.86.3
4444
github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260330133421-5151ea0c3b05

0 commit comments

Comments
 (0)