Skip to content

Commit bdcc2a6

Browse files
authored
Merge pull request authzed#1676 from sashayakovtseva/fix/concurrency-limit
Respect dispatch concurrency limits for clusterdispatch
2 parents 8470540 + 9fec6bc commit bdcc2a6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/cmd/server/server.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ func (c *Config) Complete(ctx context.Context) (RunnableServer, error) {
239239

240240
enableGRPCHistogram()
241241

242+
specificConcurrencyLimits := c.DispatchConcurrencyLimits
243+
concurrencyLimits := specificConcurrencyLimits.WithOverallDefaultLimit(c.GlobalDispatchConcurrencyLimit)
244+
242245
dispatcher := c.Dispatcher
243246
if dispatcher == nil {
244247
cc, err := c.DispatchCacheConfig.WithRevisionParameters(
@@ -257,9 +260,6 @@ func (c *Config) Complete(ctx context.Context) (RunnableServer, error) {
257260
dispatchPresharedKey = c.PresharedSecureKey[0]
258261
}
259262

260-
specificConcurrencyLimits := c.DispatchConcurrencyLimits
261-
concurrencyLimits := specificConcurrencyLimits.WithOverallDefaultLimit(c.GlobalDispatchConcurrencyLimit)
262-
263263
hashringConfigJSON, err := (&consistent.BalancerConfig{
264264
ReplicationFactor: c.DispatchHashringReplicationFactor,
265265
Spread: c.DispatchHashringSpread,
@@ -318,6 +318,7 @@ func (c *Config) Complete(ctx context.Context) (RunnableServer, error) {
318318
clusterdispatch.PrometheusSubsystem(c.DispatchClusterMetricsPrefix),
319319
clusterdispatch.Cache(cdcc),
320320
clusterdispatch.RemoteDispatchTimeout(c.DispatchUpstreamTimeout),
321+
clusterdispatch.ConcurrencyLimits(concurrencyLimits),
321322
)
322323
if err != nil {
323324
return nil, fmt.Errorf("failed to configure cluster dispatch: %w", err)

0 commit comments

Comments
 (0)