Skip to content

Commit

Permalink
Merge pull request #1676 from sashayakovtseva/fix/concurrency-limit
Browse files Browse the repository at this point in the history
Respect dispatch concurrency limits for clusterdispatch
  • Loading branch information
vroldanbet authored Jan 22, 2024
2 parents 8470540 + 9fec6bc commit bdcc2a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ func (c *Config) Complete(ctx context.Context) (RunnableServer, error) {

enableGRPCHistogram()

specificConcurrencyLimits := c.DispatchConcurrencyLimits
concurrencyLimits := specificConcurrencyLimits.WithOverallDefaultLimit(c.GlobalDispatchConcurrencyLimit)

dispatcher := c.Dispatcher
if dispatcher == nil {
cc, err := c.DispatchCacheConfig.WithRevisionParameters(
Expand All @@ -257,9 +260,6 @@ func (c *Config) Complete(ctx context.Context) (RunnableServer, error) {
dispatchPresharedKey = c.PresharedSecureKey[0]
}

specificConcurrencyLimits := c.DispatchConcurrencyLimits
concurrencyLimits := specificConcurrencyLimits.WithOverallDefaultLimit(c.GlobalDispatchConcurrencyLimit)

hashringConfigJSON, err := (&consistent.BalancerConfig{
ReplicationFactor: c.DispatchHashringReplicationFactor,
Spread: c.DispatchHashringSpread,
Expand Down Expand Up @@ -318,6 +318,7 @@ func (c *Config) Complete(ctx context.Context) (RunnableServer, error) {
clusterdispatch.PrometheusSubsystem(c.DispatchClusterMetricsPrefix),
clusterdispatch.Cache(cdcc),
clusterdispatch.RemoteDispatchTimeout(c.DispatchUpstreamTimeout),
clusterdispatch.ConcurrencyLimits(concurrencyLimits),
)
if err != nil {
return nil, fmt.Errorf("failed to configure cluster dispatch: %w", err)
Expand Down

0 comments on commit bdcc2a6

Please sign in to comment.