Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuang-Minh Nguyen <qmnguyen@gitlab.com>2023-09-28 06:40:56 +0300
committerQuang-Minh Nguyen <qmnguyen@gitlab.com>2023-09-28 06:40:56 +0300
commitb87e16084b871680a4338530e6efa315b18de94a (patch)
treec94293d8eae2e67aa37b10856642bfa5c908e95b /internal/gitaly/server
parente71de95f649e3f260aa3b775365a2abf9250d05f (diff)
limiter: Let limithandler.WithConcurrencyLimiters return created limits
limithandler.WithConcurrencyLimiters returns a function to setup per-RPC concurrency limiter. This function is called when Gitaly process creates a limiter interceptor. It creates a lot of things and notably adaptive limit structs. Currenty, those limits are not connected to the adaptive calculator. In some later commits, we need to pull those limits out and plug into the calculator so that the calculator can adjust those limits. This commit adjusts the signature of that function and let it return the configured limits.
Diffstat (limited to 'internal/gitaly/server')
-rw-r--r--internal/gitaly/server/auth_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/gitaly/server/auth_test.go b/internal/gitaly/server/auth_test.go
index 7ab5aad0e..61f289b73 100644
--- a/internal/gitaly/server/auth_test.go
+++ b/internal/gitaly/server/auth_test.go
@@ -199,7 +199,8 @@ func runServer(t *testing.T, cfg config.Cfg) string {
catfileCache := catfile.NewCache(cfg)
t.Cleanup(catfileCache.Stop)
diskCache := cache.New(cfg, locator, logger)
- limitHandler := limithandler.New(cfg, limithandler.LimitConcurrencyByRepo, limithandler.WithConcurrencyLimiters)
+ _, setupPerRPCConcurrencyLimiters := limithandler.WithConcurrencyLimiters(cfg)
+ limitHandler := limithandler.New(cfg, limithandler.LimitConcurrencyByRepo, setupPerRPCConcurrencyLimiters)
updaterWithHooks := updateref.NewUpdaterWithHooks(cfg, locator, hookManager, gitCmdFactory, catfileCache)
srv, err := NewGitalyServerFactory(cfg, logger, registry, diskCache, []*limithandler.LimiterMiddleware{limitHandler}).New(false)
@@ -237,12 +238,13 @@ func runSecureServer(t *testing.T, cfg config.Cfg) string {
conns := client.NewPool()
t.Cleanup(func() { testhelper.MustClose(t, conns) })
+ _, setupPerRPCConcurrencyLimiters := limithandler.WithConcurrencyLimiters(cfg)
srv, err := NewGitalyServerFactory(
cfg,
testhelper.SharedLogger(t),
backchannel.NewRegistry(),
cache.New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t)),
- []*limithandler.LimiterMiddleware{limithandler.New(cfg, limithandler.LimitConcurrencyByRepo, limithandler.WithConcurrencyLimiters)},
+ []*limithandler.LimiterMiddleware{limithandler.New(cfg, limithandler.LimitConcurrencyByRepo, setupPerRPCConcurrencyLimiters)},
).New(true)
require.NoError(t, err)